@@ -41,6 +41,10 @@
# define LOCALE_PARAM_DECL
#endif
+#define STRING_TYPE char
+#define USTRING_TYPE unsigned char
+#include <string/strdiff.h>
+
/* Compare S1 and S2, ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. */
@@ -53,12 +57,13 @@ __strcasecmp (s1, s2 LOCALE_PARAM)
#if defined _LIBC && !defined USE_IN_EXTENDED_LOCALE_MODEL
__locale_t loc = _NL_CURRENT_LOCALE;
#endif
+
+ STRDIFF_L (&s1, &s2, __cet_8bit);
+
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
int result;
- if (p1 == p2)
- return 0;
while ((result = TOLOWER (*p1) - TOLOWER (*p2++)) == 0)
if (*p1++ == '\0')