1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

msvcrt: Use string sort for strcoll/wcscoll.

This commit is contained in:
Daniel Lehman 2024-02-18 09:09:10 -08:00 committed by Alexandre Julliard
parent 188d880493
commit fb5302c29b
3 changed files with 6 additions and 7 deletions

View file

@ -1162,7 +1162,8 @@ int CDECL _strcoll_l( const char* str1, const char* str2, _locale_t locale )
if(!locinfo->lc_handle[LC_COLLATE])
return strcmp(str1, str2);
return CompareStringA(locinfo->lc_handle[LC_COLLATE], 0, str1, -1, str2, -1)-CSTR_EQUAL;
return CompareStringA(locinfo->lc_handle[LC_COLLATE], SORT_STRINGSORT,
str1, -1, str2, -1)-CSTR_EQUAL;
}
/*********************************************************************

View file

@ -4234,7 +4234,6 @@ static void test__tcscoll(void)
const char *str1;
const char *str2;
int exp;
BOOL todo;
};
static const struct test tests[] = {
{ "English", "ABCD", "ABCD", 0 },
@ -4242,8 +4241,8 @@ static void test__tcscoll(void)
{ "English", "ABCD", "ABC", 1 },
{ "English", "ABCe", "ABCf", -1 },
{ "English", "abcd", "ABCD", -1 },
{ "English", "AB D", "AB-D", 1, TRUE },
{ "English", "AB D", "AB'D", 1, TRUE },
{ "English", "AB D", "AB-D", 1 },
{ "English", "AB D", "AB'D", 1 },
{ "C", "ABCD", "ABCD", 0 },
{ "C", "ABC", "ABCD", -1 },
@ -4284,7 +4283,6 @@ static void test__tcscoll(void)
ok(ret < 0, "expected < 0, got %d for %s, %s for locale %s\n",
ret, str1, str2, tests[i].locale);
else
todo_wine_if(tests[i].todo)
ok(ret > 0, "expected > 0, got %d for %s, %s for locale %s\n",
ret, str1, str2, tests[i].locale);
@ -4304,7 +4302,6 @@ static void test__tcscoll(void)
ok(ret < 0, "expected < 0, got %d for %s, %s for locale %s\n",
ret, str1, str2, tests[i].locale);
else
todo_wine_if(tests[i].todo)
ok(ret > 0, "expected > 0, got %d for %s, %s for locale %s\n",
ret, str1, str2, tests[i].locale);
}

View file

@ -1994,7 +1994,8 @@ int CDECL _wcscoll_l(const wchar_t* str1, const wchar_t* str2, _locale_t locale)
if(!locinfo->lc_handle[LC_COLLATE])
return wcscmp(str1, str2);
return CompareStringW(locinfo->lc_handle[LC_COLLATE], 0, str1, -1, str2, -1)-CSTR_EQUAL;
return CompareStringW(locinfo->lc_handle[LC_COLLATE], SORT_STRINGSORT,
str1, -1, str2, -1)-CSTR_EQUAL;
}
/*********************************************************************