#include
static char *olds;
#undef strtok
char *strtok (s, delim)
char *s;
const char *delim;
{
char *token;
if (s == NULL)
s = olds;
/* Scan leading delimiters. */
s += strspn (s, delim); //將指標移到第一個非delim中的字元的位置
if (*s == "\0")
olds = s;
return NULL;
}
olds = __rawmemchr (token, "\0");
else
/* Terminate the token and make OLDS point past it. */
*s = "\0";
olds = s + 1;
return token;
#include
static char *olds;
#undef strtok
char *strtok (s, delim)
char *s;
const char *delim;
{
char *token;
if (s == NULL)
s = olds;
/* Scan leading delimiters. */
s += strspn (s, delim); //將指標移到第一個非delim中的字元的位置
if (*s == "\0")
{
olds = s;
return NULL;
}
olds = __rawmemchr (token, "\0");
else
{
/* Terminate the token and make OLDS point past it. */
*s = "\0";
olds = s + 1;
}
return token;
}