diff --git a/common/string.cpp b/common/string.cpp index d61f60310b..bdb6d39c91 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -520,13 +520,13 @@ bool WildCompareString( const wxString& pattern, const wxString& string_to_tst, bool case_sensitive ) { const wxChar* cp = NULL, * mp = NULL; - const wxChar* wild, * string; + const wxChar* wild, * str; wxString _pattern, _string_to_tst; if( case_sensitive ) { - wild = pattern.GetData(); - string = string_to_tst.GetData(); + wild = pattern.GetData(); + str = string_to_tst.GetData(); } else { @@ -535,35 +535,36 @@ bool WildCompareString( const wxString& pattern, const wxString& string_to_tst, _string_to_tst = string_to_tst; _string_to_tst.MakeUpper(); wild = _pattern.GetData(); - string = _string_to_tst.GetData(); + str = _string_to_tst.GetData(); } - while( ( *string ) && ( *wild != '*' ) ) + while( ( *str ) && ( *wild != '*' ) ) { - if( ( *wild != *string ) && ( *wild != '?' ) ) + if( ( *wild != *str ) && ( *wild != '?' ) ) return false; - wild++; string++; + wild++; + str++; } - while( *string ) + while( *str ) { if( *wild == '*' ) { if( !*++wild ) return 1; mp = wild; - cp = string + 1; + cp = str + 1; } - else if( ( *wild == *string ) || ( *wild == '?' ) ) + else if( ( *wild == *str ) || ( *wild == '?' ) ) { wild++; - string++; + str++; } else { wild = mp; - string = cp++; + str = cp++; } }