about summary refs log tree commit diff
path: root/src/string
diff options
context:
space:
mode:
Diffstat (limited to 'src/string')
-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;
 }