diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-03-01 23:24:45 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-03-01 23:24:45 -0500 |
commit | e0614f7cd418afedd06c9bcd5abb965608bc52f8 (patch) | |
tree | b4b51646b9f65279caa01c3413e42060fe95c395 /src/string/wcstok.c | |
parent | 899b13cae77469a9ed1f076c456b66d567af69d8 (diff) | |
download | musl-e0614f7cd418afedd06c9bcd5abb965608bc52f8.tar.gz |
add all missing wchar functions except floating point parsers
these are mostly untested and adapted directly from corresponding byte
string functions and similar.
Diffstat (limited to 'src/string/wcstok.c')
-rw-r--r-- | src/string/wcstok.c | 12 |
1 files changed, 12 insertions, 0 deletions
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.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; +} |