mirror of
https://github.com/fluencelabs/musl
synced 2025-05-14 16:21:28 +00:00
14 lines
230 B
C
14 lines
230 B
C
|
#include <string.h>
|
||
|
|
||
|
char *strtok(char *s, const char *sep)
|
||
|
{
|
||
|
static char *p;
|
||
|
if (!s && !(s = p)) return NULL;
|
||
|
s += strspn(s, sep);
|
||
|
if (!*s) return p = 0;
|
||
|
p = s + strcspn(s, sep);
|
||
|
if (*p) *p++ = 0;
|
||
|
else p = 0;
|
||
|
return s;
|
||
|
}
|