Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110227372
D27866.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27866.diff
View Options
diff --git a/sys/conf/files b/sys/conf/files
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -4058,6 +4058,7 @@
libkern/random.c standard
libkern/scanc.c standard
libkern/strcasecmp.c standard
+libkern/strcasestr.c standard
libkern/strcat.c standard
libkern/strchr.c standard
libkern/strchrnul.c optional gdb
diff --git a/sys/libkern/strcasestr.c b/sys/libkern/strcasestr.c
--- 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));
}
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -168,6 +168,7 @@
u_long random(void);
int scanc(u_int, const u_char *, const u_char *, int);
int strcasecmp(const char *, const char *);
+char *strcasestr(const char *, const char *);
char *strcat(char * __restrict, const char * __restrict);
char *strchr(const char *, int);
char *strchrnul(const char *, int);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 16, 10:00 AM (15 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16672328
Default Alt Text
D27866.diff (1 KB)
Attached To
Mode
D27866: Copy strcasestr from userland to kernel space
Attached
Detach File
Event Timeline
Log In to Comment