use isPrefixOf
This commit is contained in:
parent
9640417067
commit
6be516ae3b
1 changed files with 2 additions and 2 deletions
|
@ -13,6 +13,7 @@ import System.Posix.Files
|
||||||
import Control.Monad (filterM)
|
import Control.Monad (filterM)
|
||||||
import System.Path.WildMatch
|
import System.Path.WildMatch
|
||||||
import Text.Regex.PCRE.Light.Char8
|
import Text.Regex.PCRE.Light.Char8
|
||||||
|
import Data.List
|
||||||
|
|
||||||
import Types
|
import Types
|
||||||
import qualified Backend
|
import qualified Backend
|
||||||
|
@ -186,8 +187,7 @@ filterFiles l = do
|
||||||
let regexp = compile (toregex exclude) []
|
let regexp = compile (toregex exclude) []
|
||||||
return $ filter (notExcluded regexp) l'
|
return $ filter (notExcluded regexp) l'
|
||||||
where
|
where
|
||||||
notState f = stateLoc /= take stateLocLen f
|
notState f = not $ isPrefixOf stateLoc f
|
||||||
stateLocLen = length stateLoc
|
|
||||||
notExcluded r f = case match r f [] of
|
notExcluded r f = case match r f [] of
|
||||||
Nothing -> True
|
Nothing -> True
|
||||||
Just _ -> False
|
Just _ -> False
|
||||||
|
|
Loading…
Add table
Reference in a new issue