diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-14 17:45:40 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-14 17:45:40 (GMT) |
commit | c83591e81876505396a6a46cee39e32d5d289f4c (patch) | |
tree | 4e35b8696e04057c3e04f49511d4b9c130836eff /Source/kwsys | |
parent | 14715ce8137ffdcefbb9b23418c19aa5a1ed0407 (diff) | |
download | CMake-c83591e81876505396a6a46cee39e32d5d289f4c.zip CMake-c83591e81876505396a6a46cee39e32d5d289f4c.tar.gz CMake-c83591e81876505396a6a46cee39e32d5d289f4c.tar.bz2 |
Fix for Bug #9190, -U did not work on case insensitive file systems because of call to glob convert to regex that expected to work with files.
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/Glob.cxx | 10 | ||||
-rw-r--r-- | Source/kwsys/Glob.hxx.in | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index 21efca8..b34b473 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -84,7 +84,8 @@ kwsys_stl::vector<kwsys_stl::string>& Glob::GetFiles() //---------------------------------------------------------------------------- kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern, - bool require_whole_string) + bool require_whole_string, + bool preserve_case) { // Incrementally build the regular expression from the pattern. kwsys_stl::string regex = require_whole_string? "^" : ""; @@ -195,10 +196,13 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern, { // On case-insensitive systems file names are converted to lower // case before matching. - ch = tolower(ch); + if(!preserve_case) + { + ch = tolower(ch); + } } #endif - + (void)preserve_case; // Store the character. regex.append(1, static_cast<char>(ch)); } diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in index fb4eac6..638f458 100644 --- a/Source/kwsys/Glob.hxx.in +++ b/Source/kwsys/Glob.hxx.in @@ -79,7 +79,8 @@ public: whole strings, but may be disabled to support concatenating expressions more easily (regex1|regex2|etc). */ static kwsys_stl::string PatternToRegex(const kwsys_stl::string& pattern, - bool require_whole_string = true); + bool require_whole_string = true, + bool preserve_case = false); protected: //! Process directory |