X-Git-Url: http://git.jankratochvil.net/?p=reactos.git;a=blobdiff_plain;f=lib%2Fmsvcrt%2Fwstring%2Fwcstok.c;h=25f530ea232f34a4c0f2a92ca398ee15ee7e9a2d;hp=ee8c40a5debc931905041ae21b0f76edbb15258c;hb=HEAD;hpb=7c0db166f81fbe8c8b913d7f26048e337d383605 diff --git a/lib/msvcrt/wstring/wcstok.c b/lib/msvcrt/wstring/wcstok.c index ee8c40a..25f530e 100644 --- a/lib/msvcrt/wstring/wcstok.c +++ b/lib/msvcrt/wstring/wcstok.c @@ -1,14 +1,24 @@ #include #include +wchar_t** _wlasttoken(); /* wlasttok.c */ + +/* + * @implemented + */ wchar_t *wcstok(wchar_t *s, const wchar_t *ct) { const wchar_t *spanp; int c, sc; wchar_t *tok; +#if 1 + wchar_t ** wlasttoken = _wlasttoken(); +#else PTHREADDATA ThreadData = GetThreadData(); + wchar_t ** wlasttoken = &ThreadData->wlasttoken; +#endif - if (s == NULL && (s = ThreadData->wlasttoken) == NULL) + if (s == NULL && (s = *wlasttoken) == NULL) return (NULL); /* @@ -23,7 +33,7 @@ wchar_t *wcstok(wchar_t *s, const wchar_t *ct) } if (c == 0) { /* no non-ctiter characters */ - ThreadData->wlasttoken = NULL; + *wlasttoken = NULL; return (NULL); } tok = s - 2; @@ -42,7 +52,7 @@ wchar_t *wcstok(wchar_t *s, const wchar_t *ct) s = NULL; else s[-1] = 0; - ThreadData->wlasttoken = s; + *wlasttoken = s; return (tok); } spanp+=2;