Fix cmpExt
So that cmpExt "foo" "foo" will not yield a false positive.
This commit is contained in:
parent
5e5408422b
commit
9272ff32d4
6
Util.hs
6
Util.hs
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user