add all missing wchar functions except floating point parsers
[musl] / src / string / wcstok.c
diff --git a/src/string/wcstok.c b/src/string/wcstok.c
new file mode 100644 (file)
index 0000000..c932d0a
--- /dev/null
@@ -0,0 +1,12 @@
+#include <wchar.h>
+
+wchar_t *wcstok(wchar_t *s, const wchar_t *sep, wchar_t **p)
+{
+       if (!s && !(s = *p)) return NULL;
+       s += wcsspn(s, sep);
+       if (!*s) return *p = 0;
+       *p = s + wcscspn(s, sep);
+       if (**p) *(*p)++ = 0;
+       else *p = 0;
+       return s;
+}