forked from KolibriOS/kolibrios
e08c6968ef
git-svn-id: svn://kolibrios.org@9558 a494cfbc-eb01-0410-851d-a64ba20cac60
26 lines
382 B
C
26 lines
382 B
C
#include <string.h>
|
|
|
|
char* strtok(char* s,const char* delim)
|
|
// non reentrant
|
|
{
|
|
static char* savep;
|
|
char* res;
|
|
|
|
if(s)
|
|
savep = NULL;
|
|
else
|
|
s = savep;
|
|
|
|
if (*s == '\0')
|
|
return NULL;
|
|
s += strspn(s, delim);
|
|
if (*s == '\0')
|
|
return NULL;
|
|
res = s;
|
|
s += strcspn(s, delim);
|
|
savep = s + 1;
|
|
*s = '\0';
|
|
return res;
|
|
}
|
|
|