don't fail when matching an empty pattern, as in "not:"

This commit is contained in:
Simon Michael 2009-05-16 21:19:38 +00:00
parent 8eb31bc5e3
commit ef39cced4a

View File

@ -145,4 +145,4 @@ isnegativepat pat = negateprefix `isPrefixOf` pat
abspat pat = if isnegativepat pat then drop (length negateprefix) pat else pat abspat pat = if isnegativepat pat then drop (length negateprefix) pat else pat
positivepats = filter (not . isnegativepat) positivepats = filter (not . isnegativepat)
negativepats = filter isnegativepat negativepats = filter isnegativepat
matchregex pat str = containsRegex (mkRegexWithOpts pat True False) str matchregex pat str = null pat || containsRegex (mkRegexWithOpts pat True False) str