Windows: include= and exclude= containing '/' will also match filenames that are written using '\'

And vice-versa, but it's better to use '/' for portability.

Notably, standardPreferredContent contains "archive/*" and that might not
match if the filename ends up coming in with the slashes the other way
around.
This commit is contained in:
Joey Hess 2020-12-15 12:39:34 -04:00
parent e914cb0777
commit 6b13574827
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 49 additions and 17 deletions

View file

@ -115,7 +115,7 @@ limitExclude glob = Right $ MatchFiles
matchGlobFile :: String -> MatchInfo -> Annex Bool
matchGlobFile glob = go
where
cglob = compileGlob glob CaseSensative -- memoized
cglob = compileGlob glob CaseSensative (GlobFilePath True) -- memoized
go (MatchingFile fi) = pure $ matchGlob cglob (fromRawFilePath (matchFile fi))
go (MatchingInfo p) = pure $ matchGlob cglob (fromRawFilePath (providedFilePath p))
go (MatchingUserInfo p) = matchGlob cglob <$> getUserInfo (userProvidedFilePath p)
@ -166,7 +166,7 @@ matchMagic _limitname querymagic selectprovidedinfo selectuserprovidedinfo (Just
, matchNeedsLocationLog = False
}
where
cglob = compileGlob glob CaseSensative -- memoized
cglob = compileGlob glob CaseSensative (GlobFilePath False) -- memoized
go (MatchingKey _ _) = pure False
go (MatchingFile fi) = case contentFile fi of
Just f -> catchBoolIO $