diff options
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1033,3 +1033,14 @@ char *next_printf(char *s, char **start) return 0; } + +// Posix inexplicably hasn't got this, so find str in line. +char *strnstr(char *line, char *str) +{ + long len = strlen(str); + char *s; + + for (s = line; *s; s++) if (!strncasecmp(s, str, len)) break; + + return *s ? s : 0; +} |