projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
330fd96
)
replace stub with working strcasestr
author
Rich Felker
<dalias@aerifal.cx>
Fri, 22 Feb 2013 04:54:25 +0000
(23:54 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 22 Feb 2013 04:54:25 +0000
(23:54 -0500)
src/string/strcasestr.c
patch
|
blob
|
history
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)
{
- //FIXME!
- return strstr(h, n);
+ size_t l = strlen(n);
+ for (; *h; h++) if (!strncasecmp(h, n, l)) return (char *)h;
+ return 0;
}