mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 04:49:47 +00:00
msvcrt: Use string sort for strncoll/wcsncoll.
This commit is contained in:
parent
65109c725d
commit
588db48be5
|
@ -1213,7 +1213,7 @@ int CDECL _strncoll_l( const char* str1, const char* str2, size_t count, _locale
|
||||||
|
|
||||||
if(!locinfo->lc_handle[LC_COLLATE])
|
if(!locinfo->lc_handle[LC_COLLATE])
|
||||||
return strncmp(str1, str2, count);
|
return strncmp(str1, str2, count);
|
||||||
return CompareStringA(locinfo->lc_handle[LC_COLLATE], 0,
|
return CompareStringA(locinfo->lc_handle[LC_COLLATE], SORT_STRINGSORT,
|
||||||
str1, strnlen(str1, count),
|
str1, strnlen(str1, count),
|
||||||
str2, strnlen(str2, count))-CSTR_EQUAL;
|
str2, strnlen(str2, count))-CSTR_EQUAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4154,6 +4154,9 @@ static void test__tcsncoll(void)
|
||||||
{ "English", "ABCe", "ABCf", 3, 0 },
|
{ "English", "ABCe", "ABCf", 3, 0 },
|
||||||
{ "English", "abcd", "ABCD", 10, -1 },
|
{ "English", "abcd", "ABCD", 10, -1 },
|
||||||
|
|
||||||
|
{ "English", "AB D", "AB-D", 4, 1 },
|
||||||
|
{ "English", "AB D", "AB'D", 4, 1 },
|
||||||
|
|
||||||
{ "C", "ABCD", "ABCD", 4, 0 },
|
{ "C", "ABCD", "ABCD", 4, 0 },
|
||||||
{ "C", "ABCD", "ABCD", 10, 0 },
|
{ "C", "ABCD", "ABCD", 10, 0 },
|
||||||
|
|
||||||
|
@ -4165,6 +4168,9 @@ static void test__tcsncoll(void)
|
||||||
|
|
||||||
{ "C", "ABCe", "ABCf", 3, 0 },
|
{ "C", "ABCe", "ABCf", 3, 0 },
|
||||||
{ "C", "abcd", "ABCD", 10, 1 },
|
{ "C", "abcd", "ABCD", 10, 1 },
|
||||||
|
|
||||||
|
{ "C", "AB D", "AB-D", 4, -1 },
|
||||||
|
{ "C", "AB D", "AB'D", 4, -1 },
|
||||||
};
|
};
|
||||||
WCHAR str1W[16];
|
WCHAR str1W[16];
|
||||||
WCHAR str2W[16];
|
WCHAR str2W[16];
|
||||||
|
|
|
@ -538,7 +538,7 @@ int CDECL _wcsncoll_l(const wchar_t* str1, const wchar_t* str2,
|
||||||
|
|
||||||
if(!locinfo->lc_handle[LC_COLLATE])
|
if(!locinfo->lc_handle[LC_COLLATE])
|
||||||
return wcsncmp(str1, str2, count);
|
return wcsncmp(str1, str2, count);
|
||||||
return CompareStringW(locinfo->lc_handle[LC_COLLATE], 0,
|
return CompareStringW(locinfo->lc_handle[LC_COLLATE], SORT_STRINGSORT,
|
||||||
str1, wcsnlen(str1, count),
|
str1, wcsnlen(str1, count),
|
||||||
str2, wcsnlen(str2, count))-CSTR_EQUAL;
|
str2, wcsnlen(str2, count))-CSTR_EQUAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue