2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/mbsicmp.c
5 * PURPOSE: Duplicates a multi byte string
6 * PROGRAMER: Boudewijn Dekker
10 #include <msvcrt/mbstring.h>
11 #include <msvcrt/mbctype.h>
12 #include <msvcrt/ctype.h>
17 int _mbsicmp(const unsigned char *str1, const unsigned char *str2)
19 unsigned char *s1 = (unsigned char *)str1;
20 unsigned char *s2 = (unsigned char *)str2;
22 unsigned short *short_s1, *short_s2;
35 if (toupper(*s1) != toupper(*s2))
36 return toupper(*s1) - toupper(*s2);
43 short_s1 = (unsigned short *)s1;
44 short_s2 = (unsigned short *)s2;
45 if ( _mbctoupper(*short_s1) != _mbctoupper(*short_s2 ))
46 return _mbctoupper(*short_s1) - _mbctoupper(*short_s2);
57 while (toupper(*s1) == toupper(*s2))
64 return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)(s2));