Daniel Lehman : msvcrt: _towupper_l only uppercase a-z in C locale.
Alexandre Julliard
julliard at winehq.org
Mon Jan 28 16:17:02 CST 2019
Module: wine
Branch: master
Commit: 2c308c9fa2b3481d58cdea2863c0f935440ca397
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2c308c9fa2b3481d58cdea2863c0f935440ca397
Author: Daniel Lehman <dlehman25 at gmail.com>
Date: Mon Jan 28 12:08:19 2019 +0100
msvcrt: _towupper_l only uppercase a-z in C locale.
Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcrt/tests/string.c | 2 --
dlls/msvcrt/wcs.c | 13 +++++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 4f8b8b0..d0cc51b 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -3642,7 +3642,6 @@ static void test_C_locale(void)
ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret);
}
else
- todo_wine_if(ret != i)
ok(ret == i, "expected self %x, got %x for C locale\n", i, ret);
}
@@ -3672,7 +3671,6 @@ static void test_C_locale(void)
ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret);
}
else
- todo_wine_if(ret != j)
ok(ret == j, "expected self %x, got %x for C locale\n", j, ret);
}
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index d96da44..28e82ec 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -2478,6 +2478,19 @@ MSVCRT_size_t CDECL MSVCRT_wcsnlen(const MSVCRT_wchar_t *s, MSVCRT_size_t maxlen
*/
int CDECL MSVCRT__towupper_l(MSVCRT_wint_t c, MSVCRT__locale_t locale)
{
+ MSVCRT_pthreadlocinfo locinfo;
+
+ if(!locale)
+ locinfo = get_locinfo();
+ else
+ locinfo = locale->locinfo;
+
+ if(!locinfo->lc_handle[MSVCRT_LC_CTYPE]) {
+ if(c >= 'a' && c <= 'z')
+ return c + 'A' - 'a';
+ return c;
+ }
+
return toupperW(c);
}
More information about the wine-cvs
mailing list