mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
24 lines
608 B
C
24 lines
608 B
C
/* Taken from Wine Staging msvcrt/string.c */
|
|
|
|
#include <precomp.h>
|
|
#include <internal/wine/msvcrt.h>
|
|
|
|
/*********************************************************************
|
|
* strtok (MSVCRT.@)
|
|
*/
|
|
char * CDECL strtok( char *str, const char *delim )
|
|
{
|
|
thread_data_t *data = msvcrt_get_thread_data();
|
|
char *ret;
|
|
|
|
if (!str)
|
|
if (!(str = data->strtok_next)) return NULL;
|
|
|
|
while (*str && strchr( delim, *str )) str++;
|
|
if (!*str) return NULL;
|
|
ret = str++;
|
|
while (*str && !strchr( delim, *str )) str++;
|
|
if (*str) *str++ = 0;
|
|
data->strtok_next = str;
|
|
return ret;
|
|
}
|