123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include <ctype.h>
- #include <string.h>
- char *
- strcasestr(const char *s, const char *find)
- {
- char c, sc;
- size_t len;
- if ((c = *find++) != 0) {
- c = (char)tolower((unsigned char)c);
- len = strlen(find);
- do {
- do {
- if ((sc = *s++) == 0)
- return (NULL);
- } while ((char)tolower((unsigned char)sc) != c);
- } while (strncasecmp(s, find, len) != 0);
- s--;
- }
- return ((char *)s);
- }
|