huge cleanup and conversion of most string handling (especially paths) to unicode

please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
This commit is contained in:
janwas
2009-11-03 21:46:35 +00:00
parent a46f3432f3
commit 8a52113e60
317 changed files with 2517 additions and 2588 deletions
+1 -50
View File
@@ -26,56 +26,7 @@
#include "precompiled.h"
int match_wildcard(const char* s, const char* w)
{
if(!w)
return 1;
// saved position in both strings, used to expand '*':
// s2 is advanced until match.
// initially 0 - we abort on mismatch before the first '*'.
const char* s2 = 0;
const char* w2 = 0;
while(*s)
{
const int wc = *w;
if(wc == '*')
{
// wildcard string ended with * => match.
if(*++w == '\0')
return 1;
w2 = w;
s2 = s+1;
}
// match one character
else if(toupper(wc) == toupper(*s) || wc == '?')
{
w++;
s++;
}
// mismatched character
else
{
// no '*' found yet => mismatch.
if(!s2)
return 0;
// resume at previous position+1
w = w2;
s = s2++;
}
}
// strip trailing * in wildcard string
while(*w == '*')
w++;
return (*w == '\0');
}
int match_wildcardw(const wchar_t* s, const wchar_t* w)
int match_wildcard(const wchar_t* s, const wchar_t* w)
{
if(!w)
return 1;