From 9272ff32d43b652a1fd4821c1b3236f4bdee5336 Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 1 Oct 2014 23:03:09 +0200 Subject: [PATCH] Fix cmpExt So that cmpExt "foo" "foo" will not yield a false positive. --- Util.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Util.hs b/Util.hs index 90bd88d..4202bde 100644 --- a/Util.hs +++ b/Util.hs @@ -14,7 +14,11 @@ inRange min' max' (x, y) -- |Compare the extension of a file with the given String. cmpExt :: String -> FilePath -> Bool 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.