Fix case-insensitive pattern match for Windwos 9x. Thanks to Ianos Gnatiuc 2:469/335.155

This commit is contained in:
Stas Degteff 2005-08-08 11:00:43 +00:00
parent 52f60a8ee1
commit 2179b64ed1

View File

@ -64,8 +64,14 @@ void gbmh::init(const char* pattern, bool ignorecase) {
// Copy pattern
strcpy(pat, pattern);
if(ignore_case)
if(ignore_case) {
#ifndef _MSC_VER
strupr(pat);
#else /* strupr() is wrong on windows 9x (patch from Ianos Gnatiuc 2:469/335.155) */
for(char *ptr = pat; *ptr; ptr++)
*ptr = toupper(*ptr);
#endif
}
// initialize skip array
int i;