X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstring%2Fwcstok.c;fp=src%2Fstring%2Fwcstok.c;h=c932d0a06d62c935be0d1da2f0dbc66ac5a98d36;hb=e0614f7cd418afedd06c9bcd5abb965608bc52f8;hp=0000000000000000000000000000000000000000;hpb=899b13cae77469a9ed1f076c456b66d567af69d8;p=musl diff --git a/src/string/wcstok.c b/src/string/wcstok.c new file mode 100644 index 00000000..c932d0a0 --- /dev/null +++ b/src/string/wcstok.c @@ -0,0 +1,12 @@ +#include + +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; +}