diff options
| author | Rich Felker <dalias@aerifal.cx> | 2013-02-21 23:54:25 -0500 | 
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2013-02-21 23:54:25 -0500 | 
| commit | e864ddc36819814b3b9ed17620459d66add512d3 (patch) | |
| tree | c4277c89ee0e7fe05a923fc2053491a5bba84101 /src | |
| parent | 330fd96213da324f9164081df9a5226790d7c4ec (diff) | |
| download | musl-e864ddc36819814b3b9ed17620459d66add512d3.tar.gz | |
replace stub with working strcasestr
Diffstat (limited to 'src')
| -rw-r--r-- | src/string/strcasestr.c | 6 | 
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;  }  | 
