From: Jactry Zeng jzeng@codeweavers.com
--- dlls/msvcrt/string.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 571ca34b847..89e9176b2ad 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -3312,7 +3312,8 @@ int __cdecl _strnicmp_l(const char *s1, const char *s2, size_t count, _locale_t locale) { pthreadlocinfo locinfo; - int c1, c2; + BOOL is_dbcs_cp = FALSE; + int c1, c2, cp;
if(!count) return 0; @@ -3329,7 +3330,11 @@ int __cdecl _strnicmp_l(const char *s1, const char *s2, else locinfo = locale->locinfo;
- if(!locinfo->lc_handle[LC_CTYPE]) + cp = locinfo->lc_codepage; + if(cp == 932 || cp == 936 || cp == 949 || cp == 950) + is_dbcs_cp = TRUE; + + if(!locinfo->lc_handle[LC_CTYPE] || is_dbcs_cp) { do { if ((c1 = *s1++) >= 'A' && c1 <= 'Z') @@ -3338,7 +3343,7 @@ int __cdecl _strnicmp_l(const char *s1, const char *s2, c2 -= 'A' - 'a'; }while(--count && c1 && c1==c2);
- return c1-c2; + return (unsigned char)c1 - (unsigned char)c2; }
do {