X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=libs%2Fmikmod%2Fposix%2Fstrstr.c;fp=libs%2Fmikmod%2Fposix%2Fstrstr.c;h=82e1fd4927d9afaf52c133efe329566fae268013;hp=0000000000000000000000000000000000000000;hb=cf94899f4f4d8535074db6421245b973d2fcde8c;hpb=8024ae981f39d370af5cceb3cb97f62820b0a120 diff --git a/libs/mikmod/posix/strstr.c b/libs/mikmod/posix/strstr.c new file mode 100644 index 0000000..82e1fd4 --- /dev/null +++ b/libs/mikmod/posix/strstr.c @@ -0,0 +1,19 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +char *strstr(const char *haystack, const char *needle) +{ + const char *scan; + size_t len; + char firstc; + + firstc = *needle; + len = strlen(needle); + for (scan = haystack; *scan != firstc || strncmp(scan, needle, len); ) + if (!*scan++) + return NULL; + return (char *)scan; +}