Fix cmpExt

So that cmpExt "foo" "foo" will not yield a false positive.
This commit is contained in:
hasufell 2014-10-01 23:03:09 +02:00
parent 5e5408422b
commit 9272ff32d4
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -14,7 +14,11 @@ inRange min' max' (x, y)
-- |Compare the extension of a file with the given String. -- |Compare the extension of a file with the given String.
cmpExt :: String -> FilePath -> Bool cmpExt :: String -> FilePath -> Bool
cmpExt _ [] = False cmpExt _ [] = False
cmpExt ext fp = ext == getExt fp cmpExt checkExt fp
| actualExt == fp = False
| otherwise = checkExt == actualExt
where
actualExt = getExt fp
-- |Get the extension of a file. -- |Get the extension of a file.