diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index d5c227190c0..d20fa8e6a23 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -3179,8 +3179,8 @@ int CDECL MSVCRT__wstat64(const MSVCRT_wchar_t* path, struct MSVCRT__stat64 * bu /* executable? */ if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ { - ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) | - ((ULONGLONG)tolowerW(path[plen-3]) << 32); + ULONGLONG ext = MSVCRT_towlower(path[plen-1]) | (MSVCRT_towlower(path[plen-2]) << 16) | + ((ULONGLONG)MSVCRT_towlower(path[plen-3]) << 32); if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM) mode |= ALL_S_IEXEC; } diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index cc4541cceef..7c92abc4fda 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -1199,6 +1199,7 @@ char* __cdecl MSVCRT__itoa(int, char*, int); double parse_double(MSVCRT_wchar_t (*)(void*), void (*)(void*), void*, MSVCRT_pthreadlocinfo, int*); int __cdecl MSVCRT_wcsncmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t); int __cdecl MSVCRT__wcsnicmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t); +int __cdecl MSVCRT_towlower(MSVCRT_wint_t); /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd) * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index f715832c264..ec59990496d 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -411,7 +411,7 @@ int CDECL MSVCRT__wcslwr_s_l( MSVCRT_wchar_t* str, MSVCRT_size_t n, MSVCRT__loca while (n--) { if (!*ptr) return 0; - *ptr = tolowerW(*ptr); + *ptr = MSVCRT__towlower_l(*ptr, locale); ptr++; } @@ -2345,7 +2345,7 @@ __int64 CDECL MSVCRT__wcstoi64_l(const MSVCRT_wchar_t *nptr, } else if(*nptr == '+') nptr++; - if((base==0 || base==16) && wctoint(*nptr, 1)==0 && tolowerW(*(nptr+1))=='x') { + if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) { base = 16; nptr += 2; } @@ -2518,7 +2518,7 @@ unsigned __int64 CDECL MSVCRT__wcstoui64_l(const MSVCRT_wchar_t *nptr, } else if(*nptr == '+') nptr++; - if((base==0 || base==16) && wctoint(*nptr, 1)==0 && tolowerW(*(nptr+1))=='x') { + if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) { base = 16; nptr += 2; }