diff --git a/dlls/kernel/locale.c b/dlls/kernel/locale.c index b99051962c2..e05e45ed2c7 100644 --- a/dlls/kernel/locale.c +++ b/dlls/kernel/locale.c @@ -1154,6 +1154,7 @@ INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen, goto map_string_exit; } ret = wine_get_sortkey(flags, srcW, srclenW, dst, dstlen); + goto map_string_exit; } if (flags & SORT_STRINGSORT) @@ -1225,6 +1226,9 @@ INT WINAPI CompareStringA(LCID lcid, DWORD style, return 0; } + if (len1 < 0) len1 = strlen(str1); + if (len2 < 0) len2 = strlen(str2); + GetLocaleInfoW(lcid, LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, (WCHAR *)&locale_cp, (sizeof(locale_cp)/sizeof(WCHAR))); diff --git a/dlls/kernel/tests/locale.c b/dlls/kernel/tests/locale.c index 88714b42153..8b660192d25 100644 --- a/dlls/kernel/tests/locale.c +++ b/dlls/kernel/tests/locale.c @@ -719,6 +719,10 @@ char buffer1[BUFFER_SIZE], buffer2[BUFFER_SIZE]; ret = CompareStringA(lcid, NORM_IGNORECASE, buffer1, -1, buffer2, 0); ok (ret == 3, "CompareStringA (st1=%s str2=%s) expected result=3, got %d", buffer1, buffer2, ret); + + strcpy(buffer1, "Salut"); strcpy(buffer2, "saLuT"); + ret = CompareStringA(lcid, NORM_IGNORECASE, buffer1, 5, buffer2, -1); + ok (ret == 2, "CompareStringA (st1=%s str2=%s) expected result=2, got %d", buffer1, buffer2, ret); } void test_LCMapStringA(void)