Skip to content
Snippets Groups Projects
Commit 2d88c4dc authored by Brad King's avatar Brad King
Browse files

ENH: Globbing patterns should not match a slash inside a filename component.

parent eb170c85
No related branches found
No related tags found
No related merge requests found
......@@ -92,12 +92,18 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
if(c == '*')
{
// A '*' (not between brackets) matches any string.
regex += ".*";
// We modify this to not match slashes since the orignal glob
// pattern documentation was meant for matching file name
// components separated by slashes.
regex += "[^/]*";
}
else if(c == '?')
{
// A '?' (not between brackets) matches any single character.
regex += ".";
// We modify this to not match slashes since the orignal glob
// pattern documentation was meant for matching file name
// components separated by slashes.
regex += "[^/]";
}
else if(c == '[')
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment