From e864ddc36819814b3b9ed17620459d66add512d3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 21 Feb 2013 23:54:25 -0500 Subject: [PATCH] replace stub with working strcasestr --- src/string/strcasestr.c | 6 ++++-- 1 file 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 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; }