Author: akhaldi Date: Sun Aug 21 16:24:00 2016 New Revision: 72405
URL: http://svn.reactos.org/svn/reactos?rev=72405&view=rev Log: [CRT] Sync strtok_s() with Wine Staging 1.9.16 and mark strtok() as synced. CORE-11866
Added: trunk/reactos/sdk/lib/crt/string/strtok_s.c (with props) Modified: trunk/reactos/media/doc/README.WINE trunk/reactos/sdk/lib/crt/crt.cmake trunk/reactos/sdk/lib/crt/string/strtok.c
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=7... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Aug 21 16:24:00 2016 @@ -292,6 +292,8 @@ reactos/lib/sdk/crt/signal/xcptinfo.c # Synced to WineStaging-1.7.37 reactos/lib/sdk/crt/string/scanf.c/h # Synced to Wine-1.7.17 reactos/lib/sdk/crt/string/strtoi64.c # Synced to WineStaging-1.9.9 + reactos/lib/sdk/crt/string/strtok.c # Synced to WineStaging-1.9.16 + reactos/lib/sdk/crt/string/strtok_s.c # Synced to WineStaging-1.9.16 reactos/lib/sdk/crt/string/strtoul.c # Synced to WineStaging-1.9.9 reactos/lib/sdk/crt/strings/wcs.c # Synced at 20080611 reactos/lib/sdk/crt/wine/heap.c # Synced at 20080529
Modified: trunk/reactos/sdk/lib/crt/crt.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/crt.cmake?rev=7... ============================================================================== --- trunk/reactos/sdk/lib/crt/crt.cmake [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/crt/crt.cmake [iso-8859-1] Sun Aug 21 16:24:00 2016 @@ -294,6 +294,7 @@ string/strtod.c string/strtoi64.c string/strtok.c + #string/strtok_s.c string/strtol.c string/strtoul.c string/strtoull.c
Modified: trunk/reactos/sdk/lib/crt/string/strtok.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/string/strtok.c... ============================================================================== --- trunk/reactos/sdk/lib/crt/string/strtok.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/crt/string/strtok.c [iso-8859-1] Sun Aug 21 16:24:00 2016 @@ -1,4 +1,4 @@ -/* taken from wine string.c */ +/* Taken from Wine Staging msvcrt/string.c */
#include <precomp.h> #include <internal/wine/msvcrt.h> @@ -22,31 +22,3 @@ data->strtok_next = str; return ret; } - -/********************************************************************* - * strtok_s (MSVCRT.@) - */ -char * CDECL strtok_s(char *str, const char *delim, char **ctx) -{ - if (!MSVCRT_CHECK_PMT(delim != NULL) || !MSVCRT_CHECK_PMT(ctx != NULL) || - !MSVCRT_CHECK_PMT(str != NULL || *ctx != NULL)) { - *_errno() = EINVAL; - return NULL; - } - - if(!str) - str = *ctx; - - while(*str && strchr(delim, *str)) - str++; - if(!*str) - return NULL; - - *ctx = str+1; - while(**ctx && !strchr(delim, **ctx)) - (*ctx)++; - if(**ctx) - *(*ctx)++ = 0; - - return str; -}
Added: trunk/reactos/sdk/lib/crt/string/strtok_s.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/string/strtok_s... ============================================================================== --- trunk/reactos/sdk/lib/crt/string/strtok_s.c (added) +++ trunk/reactos/sdk/lib/crt/string/strtok_s.c [iso-8859-1] Sun Aug 21 16:24:00 2016 @@ -0,0 +1,30 @@ +/* Taken from Wine Staging msvcrt/string.c */ + +#include <precomp.h> +#include <internal/wine/msvcrt.h> + +/********************************************************************* + * strtok_s (MSVCRT.@) + */ +char * CDECL strtok_s(char *str, const char *delim, char **ctx) +{ + if (!MSVCRT_CHECK_PMT(delim != NULL)) return NULL; + if (!MSVCRT_CHECK_PMT(ctx != NULL)) return NULL; + if (!MSVCRT_CHECK_PMT(str != NULL || *ctx != NULL)) return NULL; + + if(!str) + str = *ctx; + + while(*str && strchr(delim, *str)) + str++; + if(!*str) + return NULL; + + *ctx = str+1; + while(**ctx && !strchr(delim, **ctx)) + (*ctx)++; + if(**ctx) + *(*ctx)++ = 0; + + return str; +}
Propchange: trunk/reactos/sdk/lib/crt/string/strtok_s.c ------------------------------------------------------------------------------ svn:eol-style = native