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

msvcrt: Add _mbclen_l implementation.

parent beb7f9fa
......@@ -1082,7 +1082,7 @@
@ cdecl _mbcjmstojis(long)
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
@ stub _mbctohira_l
@ cdecl _mbctokata(long)
......
......@@ -1439,7 +1439,7 @@
@ cdecl _mbcjmstojis(long)
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
@ stub _mbctohira_l
@ cdecl _mbctokata(long)
......
......@@ -1450,7 +1450,7 @@
@ cdecl _mbcjmstojis(long)
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
@ stub _mbctohira_l
@ cdecl _mbctokata(long)
......
......@@ -754,7 +754,7 @@
@ cdecl _mbcjmstojis(long)
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
@ stub _mbctohira_l
@ cdecl _mbctokata(long)
......
......@@ -732,7 +732,7 @@
@ cdecl _mbcjmstojis(long)
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
@ stub _mbctohira_l
@ cdecl _mbctokata(long)
......
......@@ -644,11 +644,19 @@ unsigned char* CDECL _mbsdec(const unsigned char* start, const unsigned char* cu
}
/*********************************************************************
* _mbclen_l(MSVCRT.@)
*/
size_t CDECL _mbclen_l(const unsigned char* str, _locale_t locale)
{
return _ismbblead_l(*str, locale) && str[1] ? 2 : 1;
}
/*********************************************************************
* _mbclen(MSVCRT.@)
*/
size_t CDECL _mbclen(const unsigned char* str)
{
return _ismbblead(*str) ? 2 : 1;
return _mbclen_l(str, NULL);
}
/*********************************************************************
......
......@@ -699,7 +699,7 @@
@ cdecl _mbcjmstojis(long)
# stub _mbcjmstojis_l(long ptr)
@ cdecl _mbclen(ptr)
# stub _mbclen_l(ptr ptr)
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
# stub _mbctohira_l(long ptr)
@ cdecl _mbctokata(long)
......
......@@ -366,6 +366,7 @@ static void test_mbcp(void)
expect_eq(_mbclen(mbstring), 2, int, "%d");
expect_eq(_mbclen(&mbstring[2]), 2, int, "%d");
expect_eq(_mbclen(&mbstring[3]), 1, int, "%d");
expect_eq(_mbclen(mbsonlylead), 1, int, "%d");
expect_eq(_mbslen(mbstring2), 4, int, "%d");
expect_eq(_mbslen(mbsonlylead), 0, int, "%d"); /* lead + NUL not counted as character */
expect_eq(_mbslen(mbstring), 4, int, "%d"); /* lead + invalid trail counted */
......
......@@ -597,7 +597,7 @@
@ cdecl _mbcjmstojis(long)
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
@ cdecl _mbclen_l(ptr ptr)
@ cdecl _mbctohira(long)
@ stub _mbctohira_l
@ cdecl _mbctokata(long)
......@@ -1167,7 +1167,7 @@
@ cdecl _o__mbcjmstojis(long) _mbcjmstojis
@ stub _o__mbcjmstojis_l
@ cdecl _o__mbclen(ptr) _mbclen
@ stub _o__mbclen_l
@ cdecl _o__mbclen_l(ptr ptr) _mbclen_l
@ cdecl _o__mbctohira(long) _mbctohira
@ stub _o__mbctohira_l
@ cdecl _o__mbctokata(long) _mbctokata
......
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