Commit 557a760e authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsnbcat_l implementation.

parent 37ecbf6d
......@@ -1124,7 +1124,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
@ stub _mbsnbcat_l
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
@ stub _mbsnbcat_s_l
@ cdecl _mbsnbcmp(str str long)
......
......@@ -1481,7 +1481,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
@ stub _mbsnbcat_l
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
@ stub _mbsnbcat_s_l
@ cdecl _mbsnbcmp(str str long)
......
......@@ -1492,7 +1492,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
@ stub _mbsnbcat_l
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
@ stub _mbsnbcat_s_l
@ cdecl _mbsnbcmp(str str long)
......
......@@ -796,7 +796,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
@ stub _mbsnbcat_l
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
@ stub _mbsnbcat_s_l
@ cdecl _mbsnbcmp(str str long)
......
......@@ -774,7 +774,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
@ stub _mbsnbcat_l
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
@ stub _mbsnbcat_s_l
@ cdecl _mbsnbcmp(str str long)
......
......@@ -2187,24 +2187,40 @@ size_t CDECL _mbsnbcnt(const unsigned char* str, size_t len)
}
/*********************************************************************
* _mbsnbcat(MSVCRT.@)
* _mbsnbcat_l(MSVCRT.@)
*/
unsigned char* CDECL _mbsnbcat(unsigned char* dst, const unsigned char* src, size_t len)
unsigned char* CDECL _mbsnbcat_l(unsigned char *dst, const unsigned char *src, size_t len, _locale_t locale)
{
if(get_mbcinfo()->ismbcodepage)
pthreadmbcinfo mbcinfo;
if (!MSVCRT_CHECK_PMT(dst && src))
return NULL;
if (locale)
mbcinfo = locale->mbcinfo;
else
mbcinfo = get_mbcinfo();
if (mbcinfo->ismbcodepage)
{
unsigned char *res = dst;
while (*dst) {
if (_ismbblead(*dst++)) {
if (*dst) {
dst++;
} else {
/* as per msdn overwrite the lead byte in front of '\0' */
dst--;
break;
}
}
}
while (*dst)
{
if (_ismbblead_l(*dst++, locale))
{
if (*dst)
{
dst++;
}
else
{
/* as per msdn overwrite the lead byte in front of '\0' */
dst--;
break;
}
}
}
while (*src && len--) *dst++ = *src++;
*dst = '\0';
return res;
......@@ -2212,6 +2228,14 @@ unsigned char* CDECL _mbsnbcat(unsigned char* dst, const unsigned char* src, siz
return u_strncat(dst, src, len); /* ASCII CP */
}
/*********************************************************************
* _mbsnbcat(MSVCRT.@)
*/
unsigned char* CDECL _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t len)
{
return _mbsnbcat_l(dst, src, len, NULL);
}
int CDECL _mbsnbcat_s(unsigned char *dst, size_t size, const unsigned char *src, size_t len)
{
unsigned char *ptr = dst;
......
......@@ -745,7 +745,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
# stub _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
# stub _mbsnbcat_s_l(str long ptr long ptr)
@ cdecl _mbsnbcmp(str str long)
......
......@@ -640,7 +640,7 @@
@ cdecl _mbslwr_s(str long)
@ cdecl _mbslwr_s_l(str long ptr)
@ cdecl _mbsnbcat(str str long)
@ stub _mbsnbcat_l
@ cdecl _mbsnbcat_l(str str long ptr)
@ cdecl _mbsnbcat_s(str long ptr long)
@ stub _mbsnbcat_s_l
@ cdecl _mbsnbcmp(str str long)
......@@ -1209,7 +1209,7 @@
@ cdecl _o__mbslwr_s(str long) _mbslwr_s
@ cdecl _o__mbslwr_s_l(str long ptr) _mbslwr_s_l
@ cdecl _o__mbsnbcat(str str long) _mbsnbcat
@ stub _o__mbsnbcat_l
@ cdecl _o__mbsnbcat_l(str str long ptr) _mbsnbcat_l
@ cdecl _o__mbsnbcat_s(str long ptr long) _mbsnbcat_s
@ stub _o__mbsnbcat_s_l
@ cdecl _o__mbsnbcmp(str str long) _mbsnbcmp
......
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