From 83211d99a949e91698eb30ad9fffff64c2b3eb83 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 27 May 2016 13:10:23 -0400 Subject: rename function --- Backend/Hash.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Backend') 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 -- cgit v1.2.3