Commit a67a0889 authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsncat_l implementation.

parent 12a00363
...@@ -1146,7 +1146,7 @@ ...@@ -1146,7 +1146,7 @@
@ stub _mbsnbset_s @ stub _mbsnbset_s
@ stub _mbsnbset_s_l @ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
@ stub _mbsncat_l @ cdecl _mbsncat_l(str str long ptr)
@ stub _mbsncat_s @ stub _mbsncat_s
@ stub _mbsncat_s_l @ stub _mbsncat_s_l
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
......
...@@ -1503,7 +1503,7 @@ ...@@ -1503,7 +1503,7 @@
@ stub _mbsnbset_s @ stub _mbsnbset_s
@ stub _mbsnbset_s_l @ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
@ stub _mbsncat_l @ cdecl _mbsncat_l(str str long ptr)
@ stub _mbsncat_s @ stub _mbsncat_s
@ stub _mbsncat_s_l @ stub _mbsncat_s_l
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
......
...@@ -1514,7 +1514,7 @@ ...@@ -1514,7 +1514,7 @@
@ stub _mbsnbset_s @ stub _mbsnbset_s
@ stub _mbsnbset_s_l @ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
@ stub _mbsncat_l @ cdecl _mbsncat_l(str str long ptr)
@ stub _mbsncat_s @ stub _mbsncat_s
@ stub _mbsncat_s_l @ stub _mbsncat_s_l
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
......
...@@ -818,7 +818,7 @@ ...@@ -818,7 +818,7 @@
@ stub _mbsnbset_s @ stub _mbsnbset_s
@ stub _mbsnbset_s_l @ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
@ stub _mbsncat_l @ cdecl _mbsncat_l(str str long ptr)
@ stub _mbsncat_s @ stub _mbsncat_s
@ stub _mbsncat_s_l @ stub _mbsncat_s_l
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
......
...@@ -796,7 +796,7 @@ ...@@ -796,7 +796,7 @@
@ stub _mbsnbset_s @ stub _mbsnbset_s
@ stub _mbsnbset_s_l @ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
@ stub _mbsncat_l @ cdecl _mbsncat_l(str str long ptr)
@ stub _mbsncat_s @ stub _mbsncat_s
@ stub _mbsncat_s_l @ stub _mbsncat_s_l
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
......
...@@ -2457,30 +2457,50 @@ int CDECL _mbsnbcat_s(unsigned char *dst, size_t size, const unsigned char *src, ...@@ -2457,30 +2457,50 @@ int CDECL _mbsnbcat_s(unsigned char *dst, size_t size, const unsigned char *src,
} }
/********************************************************************* /*********************************************************************
* _mbsncat(MSVCRT.@) * _mbsncat_l(MSVCRT.@)
*/ */
unsigned char* CDECL _mbsncat(unsigned char* dst, const unsigned char* src, size_t len) unsigned char* CDECL _mbsncat_l(unsigned char* dst, const unsigned char* src, size_t len, _locale_t locale)
{ {
if(get_mbcinfo()->ismbcodepage) pthreadmbcinfo mbcinfo;
{
unsigned char *res = dst; if (!len)
while (*dst) return dst;
{
if (_ismbblead(*dst++)) if (!MSVCRT_CHECK_PMT(dst && src))
dst++; return NULL;
}
while (*src && len--) if (locale)
mbcinfo = locale->mbcinfo;
else
mbcinfo = get_mbcinfo();
if (mbcinfo->ismbcodepage)
{ {
*dst++ = *src; unsigned char *res = dst;
if(_ismbblead(*src++)) while (*dst)
*dst++ = *src++; {
if (_ismbblead_l(*dst++, locale))
dst++;
}
while (*src && len--)
{
*dst++ = *src;
if (_ismbblead_l(*src++, locale))
*dst++ = *src++;
}
*dst = '\0';
return res;
} }
*dst = '\0'; return u_strncat(dst, src, len); /* ASCII CP */
return res;
}
return u_strncat(dst, src, len); /* ASCII CP */
} }
/*********************************************************************
* _mbsncat(MSVCRT.@)
*/
unsigned char* CDECL _mbsncat(unsigned char* dst, const unsigned char* src, size_t len)
{
return _mbsncat_l(dst, src, len, NULL);
}
/********************************************************************* /*********************************************************************
* _mbslwr_l(MSVCRT.@) * _mbslwr_l(MSVCRT.@)
......
...@@ -767,7 +767,7 @@ ...@@ -767,7 +767,7 @@
# stub _mbsnbset_s(ptr long long long) # stub _mbsnbset_s(ptr long long long)
# stub _mbsnbset_s_l(ptr long long long ptr) # stub _mbsnbset_s_l(ptr long long long ptr)
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
# stub _mbsncat_l(str str long ptr) @ cdecl _mbsncat_l(str str long ptr)
# stub _mbsncat_s(str long str long) # stub _mbsncat_s(str long str long)
# stub _mbsncat_s_l(str long str long ptr) # stub _mbsncat_s_l(str long str long ptr)
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
......
...@@ -662,7 +662,7 @@ ...@@ -662,7 +662,7 @@
@ stub _mbsnbset_s @ stub _mbsnbset_s
@ stub _mbsnbset_s_l @ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long) @ cdecl _mbsncat(str str long)
@ stub _mbsncat_l @ cdecl _mbsncat_l(str str long ptr)
@ stub _mbsncat_s @ stub _mbsncat_s
@ stub _mbsncat_s_l @ stub _mbsncat_s_l
@ cdecl _mbsnccnt(str long) @ cdecl _mbsnccnt(str long)
...@@ -1231,7 +1231,7 @@ ...@@ -1231,7 +1231,7 @@
@ stub _o__mbsnbset_s @ stub _o__mbsnbset_s
@ stub _o__mbsnbset_s_l @ stub _o__mbsnbset_s_l
@ cdecl _o__mbsncat(str str long) _mbsncat @ cdecl _o__mbsncat(str str long) _mbsncat
@ stub _o__mbsncat_l @ cdecl _o__mbsncat_l(str str long ptr) _mbsncat_l
@ stub _o__mbsncat_s @ stub _o__mbsncat_s
@ stub _o__mbsncat_s_l @ stub _o__mbsncat_s_l
@ cdecl _o__mbsnccnt(str long) _mbsnccnt @ cdecl _o__mbsnccnt(str long) _mbsnccnt
......
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