Commit 9b64ea2b authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsupr_s_l partial implementation.

parent 01f3beef
......@@ -1202,7 +1202,7 @@
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_s(str long)
@ stub _mbsupr_s_l
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
......@@ -1559,7 +1559,7 @@
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_s(str long)
@ stub _mbsupr_s_l
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
......@@ -1570,7 +1570,7 @@
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_s(str long)
@ stub _mbsupr_s_l
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
......@@ -874,7 +874,7 @@
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_s(str long)
@ stub _mbsupr_s_l
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
......@@ -852,7 +852,7 @@
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_s(str long)
@ stub _mbsupr_s_l
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
......@@ -2145,11 +2145,10 @@ unsigned char* CDECL _mbsupr(unsigned char* s)
return ret;
}
/*********************************************************************
* _mbsupr_s(MSVCRT.@)
* _mbsupr_s_l(MSVCRT.@)
*/
int CDECL _mbsupr_s(unsigned char* s, size_t len)
int CDECL _mbsupr_s_l(unsigned char* s, size_t len, _locale_t locale)
{
if (!s && !len)
{
......@@ -2160,12 +2159,13 @@ int CDECL _mbsupr_s(unsigned char* s, size_t len)
*_errno() = EINVAL;
return EINVAL;
}
if (get_mbcinfo()->ismbcodepage)
{
unsigned int c;
for ( ; *s && len > 0; len--)
{
c = _mbctoupper(_mbsnextc(s));
c = _mbctoupper_l(_mbsnextc_l(s, locale), locale);
/* Note that I assume that the size of the character is unchanged */
if (c > 255)
{
......@@ -2175,7 +2175,12 @@ int CDECL _mbsupr_s(unsigned char* s, size_t len)
*s++=c;
}
}
else for ( ; *s && len > 0; s++, len--) *s = _toupper_l(*s, NULL);
else
{
for ( ; *s && len > 0; s++, len--)
*s = _toupper_l(*s, locale);
}
if (*s)
{
*s = '\0';
......@@ -2186,6 +2191,14 @@ int CDECL _mbsupr_s(unsigned char* s, size_t len)
}
/*********************************************************************
* _mbsupr_s(MSVCRT.@)
*/
int CDECL _mbsupr_s(unsigned char* s, size_t len)
{
return _mbsupr_s_l(s, len, NULL);
}
/*********************************************************************
* _mbsspn_l (MSVCRT.@)
*/
size_t CDECL _mbsspn_l(const unsigned char* string,
......
......@@ -823,7 +823,7 @@
@ cdecl _mbsupr(str)
# stub _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
# stub _mbsupr_s_l(str long ptr)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
......@@ -717,7 +717,7 @@
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_s(str long)
@ stub _mbsupr_s_l
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment