summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-01-27 16:31:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-01-27 16:31:29 -0400
commit6be516ae3bddb8f05ea62661019836e03be12a2c (patch)
treeb2c4408b1950a4db2da110413cda5dce0c5b1e03
parent96404170673e4ff42b68de1ba967a09a88dd550e (diff)
use isPrefixOf
-rw-r--r--Command.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command.hs b/Command.hs
index cbfb26500..bedb18cc9 100644
--- a/Command.hs
+++ b/Command.hs
@@ -13,6 +13,7 @@ import System.Posix.Files
import Control.Monad (filterM)
import System.Path.WildMatch
import Text.Regex.PCRE.Light.Char8
+import Data.List
import Types
import qualified Backend
@@ -186,8 +187,7 @@ filterFiles l = do
let regexp = compile (toregex exclude) []
return $ filter (notExcluded regexp) l'
where
- notState f = stateLoc /= take stateLocLen f
- stateLocLen = length stateLoc
+ notState f = not $ isPrefixOf stateLoc f
notExcluded r f = case match r f [] of
Nothing -> True
Just _ -> False