1 --- strcasecmp.c.orig 2003-05-20 15:23:54.000000000 -0700
2 +++ strcasecmp.c 2005-02-18 18:46:40.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/string/strcasecmp.c,v 1.6 2002/08/30 15:40:01 robert Exp $");
7 +#include "xlocale_private.h"
12 typedef unsigned char u_char;
16 +strcasecmp_l(s1, s2, loc)
21 *us1 = (const u_char *)s1,
22 *us2 = (const u_char *)s2;
24 - while (tolower(*us1) == tolower(*us2++))
25 + NORMALIZE_LOCALE(loc);
26 + while (tolower_l(*us1, loc) == tolower_l(*us2++, loc))
29 - return (tolower(*us1) - tolower(*--us2));
30 + return (tolower_l(*us1, loc) - tolower_l(*--us2, loc));
34 -strncasecmp(s1, s2, n)
36 + const char *s1, *s2;
38 + return strcasecmp_l(s1, s2, __current_locale());
42 +strncasecmp_l(s1, s2, n, loc)
47 + NORMALIZE_LOCALE(loc);
50 *us1 = (const u_char *)s1,
51 *us2 = (const u_char *)s2;
54 - if (tolower(*us1) != tolower(*us2++))
55 - return (tolower(*us1) - tolower(*--us2));
56 + if (tolower_l(*us1, loc) != tolower_l(*us2++, loc))
57 + return (tolower_l(*us1, loc) - tolower_l(*--us2, loc));
66 +strncasecmp(s1, s2, n)
67 + const char *s1, *s2;
70 + return strncasecmp_l(s1, s2, n, __current_locale());