1 --- strcasestr.c.bsdnew 2009-11-18 18:24:33.000000000 -0800
2 +++ strcasestr.c 2009-11-18 18:24:33.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/string/strcasestr.c,v 1.5 2009/02/03 17:58:20 danger Exp $");
7 +#include "xlocale_private.h"
12 @@ -40,21 +42,30 @@ __FBSDID("$FreeBSD: src/lib/libc/string/
13 * Find the first occurrence of find in s, ignore case.
16 -strcasestr(const char *s, const char *find)
17 +strcasestr_l(s, find, loc)
18 + const char *s, *find;
24 + NORMALIZE_LOCALE(loc);
25 if ((c = *find++) != 0) {
26 - c = tolower((unsigned char)c);
27 + c = tolower_l((unsigned char)c, loc);
33 - } while ((char)tolower((unsigned char)sc) != c);
34 - } while (strncasecmp(s, find, len) != 0);
35 + } while ((char)tolower_l((unsigned char)sc, loc) != c);
36 + } while (strncasecmp_l(s, find, len, loc) != 0);
43 +strcasestr(const char *s, const char *find)
45 + return strcasestr_l(s, find, __current_locale());