Commit 7ccf8bc8 authored by François Gouget's avatar François Gouget Committed by Alexandre Julliard

Implemented _mbsnbicmp.

parent 79313d37
......@@ -412,6 +412,51 @@ int _mbsnicmp(const unsigned char* str, const unsigned char* cmp, MSVCRT_size_t
}
/*********************************************************************
* _mbsnbicmp(MSVCRT.@)
*/
int _mbsnbicmp(const unsigned char* str, const unsigned char* cmp, MSVCRT_size_t len)
{
if (!len)
return 0;
if(MSVCRT___mb_cur_max > 1)
{
unsigned int strc, cmpc;
while (len)
{
int clen;
if(!*str)
return *cmp ? -1 : 0;
if(!*cmp)
return 1;
if (MSVCRT_isleadbyte(*str))
{
strc=(len>=2)?_mbsnextc(str):0;
clen=2;
}
else
{
strc=*str;
clen=1;
}
if (MSVCRT_isleadbyte(*cmp))
cmpc=(len>=2)?_mbsnextc(cmp):0;
else
cmpc=*str;
strc = _mbctolower(strc);
cmpc = _mbctolower(cmpc);
if(strc != cmpc)
return strc < cmpc ? -1 : 1;
len -= clen;
str += clen;
cmp += clen;
}
return 0; /* Matched len bytes */
FIXME("%s %s %d\n",str,cmp,len);
}
return strncmp(str,cmp,len);
}
/*********************************************************************
* _mbschr(MSVCRT.@)
*
* Find a multibyte character in a multibyte string.
......
......@@ -370,7 +370,7 @@ debug_channels (msvcrt)
@ cdecl _mbsnbcnt(ptr long) _mbsnbcnt
@ stub _mbsnbcoll #(str str long)
@ cdecl _mbsnbcpy(ptr str long) _mbsnbcpy
@ stub _mbsnbicmp #(str str long)
@ cdecl _mbsnbicmp(str str long) _mbsnbicmp
@ stub _mbsnbicoll #(str str long)
@ stub _mbsnbset #(str long long)
@ cdecl _mbsncat(str str long) _mbsncat
......
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