projects
/
oweals
/
musl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
work around gcc 4.8's generation of self-referential mem* functions at -O3
[oweals/musl.git]
/
src
/
string
/
strcasestr.c
diff --git
a/src/string/strcasestr.c
b/src/string/strcasestr.c
index f1cb0e840d4d395ba1d2db995e00aea8886e1149..af109f3611bd4d917fc9311308006b867bcd8780 100644
(file)
--- a/
src/string/strcasestr.c
+++ b/
src/string/strcasestr.c
@@
-1,7
+1,9
@@
+#define _GNU_SOURCE
#include <string.h>
char *strcasestr(const char *h, const char *n)
{
#include <string.h>
char *strcasestr(const char *h, const char *n)
{
- //FIXME!
- return strstr(h, n);
+ size_t l = strlen(n);
+ for (; *h; h++) if (!strncasecmp(h, n, l)) return (char *)h;
+ return 0;
}
}