Changeset 3047 for box/trunk


Ignore:
Timestamp:
03/12/2011 23:07:41 (6 months ago)
Author:
chris
Message:

Fix regex case issues on Windows (\S converted to \s for example). Ensure that
filename comparison is always case insensitive on Windows, by convention.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/common/ExcludeList.cpp

    r1859 r3047  
    100100        { 
    101101                output.replace(pos, 1, "\\" DIRECTORY_SEPARATOR); 
    102         } 
    103  
    104         for (std::string::iterator i = output.begin(); i != output.end(); i++) 
    105         { 
    106                 *i = tolower(*i); 
    107102        } 
    108103 
     
    186181                        { 
    187182                                std::string entry = *i; 
     183                                int flags = REG_EXTENDED | REG_NOSUB; 
    188184 
    189185                                // Convert any forward slashes in the string 
     
    192188                                #ifdef WIN32 
    193189                                entry = ReplaceSlashesRegex(entry); 
     190                                flags |= REG_ICASE; // Windows convention 
    194191                                #endif 
    195192 
    196193                                // Compile 
    197                                 int errcode = ::regcomp(pregex, entry.c_str(),  
    198                                         REG_EXTENDED | REG_NOSUB); 
     194                                int errcode = ::regcomp(pregex, entry.c_str(), 
     195                                        flags); 
    199196 
    200197                                if (errcode != 0) 
     
    239236 
    240237        #ifdef WIN32 
     238        // converts to lower case as well 
    241239        test = ReplaceSlashesDefinite(test); 
    242240        #endif 
Note: See TracChangeset for help on using the changeset viewer.