summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-02-21 23:54:25 -0500
committerRich Felker <dalias@aerifal.cx>2013-02-21 23:54:25 -0500
commite864ddc36819814b3b9ed17620459d66add512d3 (patch)
treec4277c89ee0e7fe05a923fc2053491a5bba84101
parent330fd96213da324f9164081df9a5226790d7c4ec (diff)
downloadmusl-e864ddc36819814b3b9ed17620459d66add512d3.tar.gz
musl-e864ddc36819814b3b9ed17620459d66add512d3.tar.bz2
musl-e864ddc36819814b3b9ed17620459d66add512d3.tar.xz
musl-e864ddc36819814b3b9ed17620459d66add512d3.zip
replace stub with working strcasestr
-rw-r--r--src/string/strcasestr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/string/strcasestr.c b/src/string/strcasestr.c
index f1cb0e84..af109f36 100644
--- 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;
}