☰
Debian Codegraph
@
0.0~git20260129.ec0effd-3
0.0~git20260129.ec0effd-2
/
/
libc-top-half
/
musl
/
src
/
string
/
strtok.c
☽
☼
libc-top-half/musl/src/string/strtok.c
code
plain
raw
MIT
2005-2019 Rich Felker <
[email protected]
>; 2005-2019 Many other contributors
debian/copyright
1
#include <string.h>
2
3
char *strtok(char *restrict s, const char *restrict sep)
4
{
5
static char *p;
6
if (!s && !(s = p)) return NULL;
7
s += strspn(s, sep);
8
if (!*s) return p = 0;
9
p = s + strcspn(s, sep);
10
if (*p) *p++ = 0;
11
else p = 0;
12
return s;
13
}