Skip to content
Snippets Groups Projects
Commit 97541a29 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

Fix for Bug #9190, -U did not work on case insensitive file systems because of...

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.
parent f3beae21
No related branches found
No related tags found
No related merge requests found
......@@ -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));
}
......
......@@ -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
......
......@@ -7,4 +7,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2009)
SET(KWSYS_DATE_STAMP_MONTH 09)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 03)
SET(KWSYS_DATE_STAMP_DAY 14)
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