summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/Glob.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-25 16:13:37 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-25 16:13:37 (GMT)
commit6849ae856b31950be630e453318d93a7d69f6bee (patch)
tree5cc1c6f923847dd3ac25f852611071988cc7d7ae /Source/kwsys/Glob.cxx
parentb4e1de78869ddd08f84b18ed6a3398043533e7d7 (diff)
downloadCMake-6849ae856b31950be630e453318d93a7d69f6bee.zip
CMake-6849ae856b31950be630e453318d93a7d69f6bee.tar.gz
CMake-6849ae856b31950be630e453318d93a7d69f6bee.tar.bz2
ENH: Globbing patterns should not match a slash inside a filename component.
Diffstat (limited to 'Source/kwsys/Glob.cxx')
-rw-r--r--Source/kwsys/Glob.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index d86b9e0..7ef2fed 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -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 == '[')
{