diff options
author | Brad King <brad.king@kitware.com> | 2006-08-25 16:13:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-25 16:13:37 (GMT) |
commit | 6849ae856b31950be630e453318d93a7d69f6bee (patch) | |
tree | 5cc1c6f923847dd3ac25f852611071988cc7d7ae /Source/kwsys/Glob.cxx | |
parent | b4e1de78869ddd08f84b18ed6a3398043533e7d7 (diff) | |
download | CMake-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.cxx | 10 |
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 == '[') { |