From: Daniel Lehman Subject: [PATCH 3/4] msvcrt: Only uppercase a-z in C locale. Message-Id: <20181127041814.13196-3-dlehman25@gmail.com> Date: Mon, 26 Nov 2018 20:18:13 -0800 In-Reply-To: <20181127041814.13196-1-dlehman25@gmail.com> References: <20181127041814.13196-1-dlehman25@gmail.com> Signed-off-by: Daniel Lehman --- 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 d0f94bcf97..8778ab2568 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -3636,7 +3636,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); } @@ -3666,7 +3665,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 d96da44737..28e82ec303 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); } -- 2.17.1