msvcrt: Use internal tolower implementation.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Piotr Caban 2019-03-26 11:31:01 +01:00 committed by Alexandre Julliard
parent a799d41687
commit 834134f284
3 changed files with 19 additions and 16 deletions

View File

@ -3020,8 +3020,9 @@ int CDECL MSVCRT_stat64(const char* path, struct MSVCRT__stat64 * buf)
/* executable? */
if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */
{
unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) |
(tolower(path[plen-3]) << 16);
unsigned int ext = MSVCRT__tolower_l(path[plen-1], NULL) |
(MSVCRT__tolower_l(path[plen-2], NULL) << 8) |
(MSVCRT__tolower_l(path[plen-3], NULL) << 16);
if (ext == EXE || ext == BAT || ext == CMD || ext == COM)
mode |= ALL_S_IEXEC;
}

View File

@ -404,7 +404,7 @@ unsigned int CDECL _mbctolower(unsigned int c)
FIXME("Handle MBC chars\n");
return c;
}
return tolower(c); /* ASCII CP or SB char */
return MSVCRT__tolower_l(c, NULL); /* ASCII CP or SB char */
}
/*********************************************************************
@ -1909,7 +1909,7 @@ unsigned char* CDECL _mbslwr(unsigned char* s)
*s++=c;
}
}
else for ( ; *s; s++) *s = tolower(*s);
else for ( ; *s; s++) *s = MSVCRT__tolower_l(*s, NULL);
return ret;
}
@ -1943,7 +1943,7 @@ int CDECL _mbslwr_s(unsigned char* s, MSVCRT_size_t len)
*s++=c;
}
}
else for ( ; *s && len > 0; s++, len--) *s = tolower(*s);
else for ( ; *s && len > 0; s++, len--) *s = MSVCRT__tolower_l(*s, NULL);
if (*s)
{
*s = '\0';

View File

@ -362,23 +362,25 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
p++;
#if _MSVCR_VER >= 140
if(tolower(p[0]) == 'i' && tolower(p[1]) == 'n' && tolower(p[2]) == 'f') {
if(MSVCRT__tolower_l(p[0], locale) == 'i' && MSVCRT__tolower_l(p[1], locale) == 'n'
&& MSVCRT__tolower_l(p[2], locale) == 'f') {
if(end)
*end = (char*) &p[3];
if(tolower(p[3]) == 'i' && tolower(p[4]) == 'n' && tolower(p[5]) == 'i' &&
tolower(p[6]) == 't' && tolower(p[7]) == 'y' && end)
if(MSVCRT__tolower_l(p[3], locale) == 'i' && MSVCRT__tolower_l(p[4], locale) == 'n'
&& MSVCRT__tolower_l(p[5], locale) == 'i' && MSVCRT__tolower_l(p[6], locale) == 't'
&& MSVCRT__tolower_l(p[7], locale) == 'y' && end)
*end = (char*) &p[8];
return sign*INFINITY;
}
if(tolower(p[0]) == 'n' &&
tolower(p[1]) == 'a' &&
tolower(p[2]) == 'n') {
if(MSVCRT__tolower_l(p[0], locale) == 'n' &&
MSVCRT__tolower_l(p[1], locale) == 'a' &&
MSVCRT__tolower_l(p[2], locale) == 'n') {
if(end)
*end = (char*) &p[3];
return NAN;
}
if(p[0] == '0' && tolower(p[1]) == 'x') {
if(p[0] == '0' && MSVCRT__tolower_l(p[1], locale) == 'x') {
base = 16;
expcnt = 2;
p += 2;
@ -963,7 +965,7 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, MSVCR
} else if(*nptr == '+')
nptr++;
if((base==0 || base==16) && *nptr=='0' && tolower(*(nptr+1))=='x') {
if((base==0 || base==16) && *nptr=='0' && MSVCRT__tolower_l(*(nptr+1), locale)=='x') {
base = 16;
nptr += 2;
}
@ -976,7 +978,7 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, MSVCR
}
while(*nptr) {
char cur = tolower(*nptr);
char cur = MSVCRT__tolower_l(*nptr, locale);
int v;
if(cur>='0' && cur<='9') {
@ -1215,7 +1217,7 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b
} else if(*nptr == '+')
nptr++;
if((base==0 || base==16) && *nptr=='0' && tolower(*(nptr+1))=='x') {
if((base==0 || base==16) && *nptr=='0' && MSVCRT__tolower_l(*(nptr+1), locale)=='x') {
base = 16;
nptr += 2;
}
@ -1228,7 +1230,7 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b
}
while(*nptr) {
char cur = tolower(*nptr);
char cur = MSVCRT__tolower_l(*nptr, locale);
int v;
if(cur>='0' && cur<='9') {