Daniel Lehman : msvcrt: _towlower_l only lowercase A-Z in C locale.

Alexandre Julliard julliard at winehq.org
Mon Jan 28 16:17:02 CST 2019


Module: wine
Branch: master
Commit: 6a71e7c9ee1f5378b4744323b8f4b99855e0f22b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6a71e7c9ee1f5378b4744323b8f4b99855e0f22b

Author: Daniel Lehman <dlehman25 at gmail.com>
Date:   Mon Jan 28 12:08:11 2019 +0100

msvcrt: _towlower_l only lowercase 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 a159132..4f8b8b0 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -3633,7 +3633,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);
 
         ret = p_towupper(i);
@@ -3664,7 +3663,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);
 
             ret = p__towupper_l(j, locale);
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index a6d7c1f..d96da44 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -2494,6 +2494,19 @@ int CDECL MSVCRT_towupper(MSVCRT_wint_t c)
  */
 int CDECL MSVCRT__towlower_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 tolowerW(c);
 }
 




More information about the wine-cvs mailing list