git://git.jankratochvil.net
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update for HEAD-2003091401
[reactos.git]
/
lib
/
msvcrt
/
wstring
/
wcstok.c
diff --git
a/lib/msvcrt/wstring/wcstok.c
b/lib/msvcrt/wstring/wcstok.c
index
ee8c40a
..
25f530e
100644
(file)
--- a/
lib/msvcrt/wstring/wcstok.c
+++ b/
lib/msvcrt/wstring/wcstok.c
@@
-1,14
+1,24
@@
#include <msvcrt/string.h>
#include <msvcrt/internal/tls.h>
#include <msvcrt/string.h>
#include <msvcrt/internal/tls.h>
+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;
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();
PTHREADDATA ThreadData = GetThreadData();
+ wchar_t ** wlasttoken = &ThreadData->wlasttoken;
+#endif
- if (s == NULL && (s =
ThreadData->
wlasttoken) == NULL)
+ if (s == NULL && (s =
*
wlasttoken) == NULL)
return (NULL);
/*
return (NULL);
/*
@@
-23,7
+33,7
@@
wchar_t *wcstok(wchar_t *s, const wchar_t *ct)
}
if (c == 0) { /* no non-ctiter characters */
}
if (c == 0) { /* no non-ctiter characters */
-
ThreadData->
wlasttoken = NULL;
+
*
wlasttoken = NULL;
return (NULL);
}
tok = s - 2;
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;
s = NULL;
else
s[-1] = 0;
-
ThreadData->
wlasttoken = s;
+
*
wlasttoken = s;
return (tok);
}
spanp+=2;
return (tok);
}
spanp+=2;