Commit 588db48b authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msvcrt: Use string sort for strncoll/wcsncoll.

parent 65109c72
......@@ -1213,7 +1213,7 @@ int CDECL _strncoll_l( const char* str1, const char* str2, size_t count, _locale
if(!locinfo->lc_handle[LC_COLLATE])
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),
str2, strnlen(str2, count))-CSTR_EQUAL;
}
......
......@@ -4154,6 +4154,9 @@ static void test__tcsncoll(void)
{ "English", "ABCe", "ABCf", 3, 0 },
{ "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", 10, 0 },
......@@ -4165,6 +4168,9 @@ static void test__tcsncoll(void)
{ "C", "ABCe", "ABCf", 3, 0 },
{ "C", "abcd", "ABCD", 10, 1 },
{ "C", "AB D", "AB-D", 4, -1 },
{ "C", "AB D", "AB'D", 4, -1 },
};
WCHAR str1W[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])
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),
str2, wcsnlen(str2, count))-CSTR_EQUAL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment