Commits

Anonymous committed 44ffc43

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.

Comments (0)

Files changed (2)

GCC_XML/KWSys/Glob.cxx

 
 //----------------------------------------------------------------------------
 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? "^" : "";
         {
         // 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));
       }

GCC_XML/KWSys/Glob.hxx.in

       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