add mikmod source
[dosdemo] / libs / mikmod / posix / strstr.c
diff --git a/libs/mikmod/posix/strstr.c b/libs/mikmod/posix/strstr.c
new file mode 100644 (file)
index 0000000..82e1fd4
--- /dev/null
@@ -0,0 +1,19 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+
+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;
+}