CompareStringW returned wrong results sometimes.

This commit is contained in:
Andreas Mohr 2000-11-25 01:25:16 +00:00 committed by Alexandre Julliard
parent 3391555145
commit f2918f9e9e
1 changed files with 4 additions and 1 deletions

View File

@ -2533,7 +2533,10 @@ UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle,
len = l1<l2 ? l1:l2;
ret = (fdwStyle & NORM_IGNORECASE) ? strncmpiW(s1,s2,len) : strncmpW(s1,s2,len);
/* not equal, return 1 or 3 */
if(ret!=0) return ret+2;
if(ret!=0) {
/* need to translate result */
return ((int)ret < 0) ? 1 : 3;
}
/* same len, return 2 */
if(l1==l2) return 2;
/* the longer one is lexically greater */