aboutsummaryrefslogtreecommitdiff
path: root/sys/libkern
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2020-10-06 14:50:52 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2021-01-07 23:18:42 +0000
commitbc861033357ef2d2eeaf5d85d70bb4b638961b2d (patch)
treedeb67c2e8730bdff7ff7e09d22bd466c792509ec /sys/libkern
parent92cf602e3809f2bcb0490b3895025b0185e2daa9 (diff)
downloadsrc-bc861033357ef2d2eeaf5d85d70bb4b638961b2d.tar.gz
src-bc861033357ef2d2eeaf5d85d70bb4b638961b2d.zip
libkern/strcasestr.c: Drop xlocale support and connect to build.
Reviewed by: markj, hselasky Differential revision: https://reviews.freebsd.org/D27866
Diffstat (limited to 'sys/libkern')
-rw-r--r--sys/libkern/strcasestr.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sys/libkern/strcasestr.c b/sys/libkern/strcasestr.c
index b70c2195a94e..c0418cfaeb3d 100644
--- a/sys/libkern/strcasestr.c
+++ b/sys/libkern/strcasestr.c
@@ -40,35 +40,29 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <ctype.h>
-#include <string.h>
-#include "xlocale_private.h"
+#include <sys/param.h>
+#include <sys/ctype.h>
+#include <sys/libkern.h>
/*
* Find the first occurrence of find in s, ignore case.
*/
char *
-strcasestr_l(const char *s, const char *find, locale_t locale)
+strcasestr(const char *s, const char *find)
{
char c, sc;
size_t len;
- FIX_LOCALE(locale);
if ((c = *find++) != 0) {
- c = tolower_l((unsigned char)c, locale);
+ c = tolower((unsigned char)c);
len = strlen(find);
do {
do {
if ((sc = *s++) == 0)
return (NULL);
- } while ((char)tolower_l((unsigned char)sc, locale) != c);
- } while (strncasecmp_l(s, find, len, locale) != 0);
+ } while ((char)tolower((unsigned char)sc) != c);
+ } while (strncasecmp(s, find, len) != 0);
s--;
}
- return ((char *)s);
-}
-char *
-strcasestr(const char *s, const char *find)
-{
- return strcasestr_l(s, find, __get_locale());
+ return (__DECONST(char *, s));
}