Piotr Caban : msvcrt: Don't use tolowerW and toupperW in _setmbcp_l.
Alexandre Julliard
julliard at winehq.org
Thu Jul 16 19:01:22 CDT 2020
Module: wine
Branch: master
Commit: 4f5a4b83b6b5df5585770c3ac1e2d28de8fe01a1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4f5a4b83b6b5df5585770c3ac1e2d28de8fe01a1
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu Jul 16 14:46:57 2020 +0200
msvcrt: Don't use tolowerW and toupperW in _setmbcp_l.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcrt/mbcs.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index 5215eff0e3..f9868635e1 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -209,7 +209,7 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo)
BYTE *bytes;
WORD chartypes[256];
char bufA[256];
- WCHAR bufW[256];
+ WCHAR bufW[256], lowW[256], upW[256];
int charcount;
int ret;
int i;
@@ -310,6 +310,8 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo)
ERR("MultiByteToWideChar of chars failed for cp %d, ret=%d (exp %d), error=%d\n", newcp, ret, charcount, GetLastError());
GetStringTypeW(CT_CTYPE1, bufW, charcount, chartypes);
+ LCMapStringW(lcid, LCMAP_LOWERCASE, bufW, charcount, lowW, charcount);
+ LCMapStringW(lcid, LCMAP_UPPERCASE, bufW, charcount, upW, charcount);
charcount = 0;
for (i = 0; i < 256; i++)
@@ -318,12 +320,12 @@ int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo)
if (chartypes[charcount] & C1_UPPER)
{
mbcinfo->mbctype[i + 1] |= _SBUP;
- bufW[charcount] = tolowerW(bufW[charcount]);
+ bufW[charcount] = lowW[charcount];
}
else if (chartypes[charcount] & C1_LOWER)
{
mbcinfo->mbctype[i + 1] |= _SBLOW;
- bufW[charcount] = toupperW(bufW[charcount]);
+ bufW[charcount] = upW[charcount];
}
charcount++;
}
More information about the wine-cvs
mailing list