diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-05-27 13:10:23 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-05-27 13:10:23 -0400 |
commit | 83211d99a949e91698eb30ad9fffff64c2b3eb83 (patch) | |
tree | 3b75f6a37f3015faa96af4788d974ae06adcd82a /Backend | |
parent | 2ff33a429da228df504c43b208a4873f7b511c7e (diff) |
rename function
Diffstat (limited to 'Backend')
-rw-r--r-- | Backend/Hash.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Backend/Hash.hs b/Backend/Hash.hs index 6f42cac88..fd51d87ce 100644 --- a/Backend/Hash.hs +++ b/Backend/Hash.hs @@ -102,7 +102,7 @@ selectExtension f where es = filter (not . null) $ reverse $ take 2 $ takeWhile shortenough $ - reverse $ split "." $ filter validExtension $ takeExtensions f + reverse $ split "." $ filter validInExtension $ takeExtensions f shortenough e = length e <= 4 -- long enough for "jpeg" {- A key's checksum is checked during fsck. -} @@ -133,8 +133,8 @@ checkKeyChecksum hash key file = catchIOErrorType HardwareFault hwfault $ do keyHash :: Key -> String keyHash key = dropExtensions (keyName key) -validExtension :: Char -> Bool -validExtension c +validInExtension :: Char -> Bool +validInExtension c | isAlphaNum c = True | c == '.' = True | otherwise = False @@ -143,7 +143,7 @@ validExtension c - that contain non-alphanumeric characters in their extension. -} needsUpgrade :: Key -> Bool needsUpgrade key = "\\" `isPrefixOf` keyHash key || - any (not . validExtension) (takeExtensions $ keyName key) + any (not . validInExtension) (takeExtensions $ keyName key) trivialMigrate :: Key -> Backend -> AssociatedFile -> Maybe Key trivialMigrate oldkey newbackend afile |