File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 2727
2828#ifdef __MINGW32__
2929# include <Winsock.h>
30+ /*
31+ * public domain strtok_r() by Charlie Gordon
32+ *
33+ * from comp.lang.c 9/14/2007
34+ *
35+ * http://groups.google.com/group/comp.lang.c/msg/2ab1ecbb86646684
36+ *
37+ * (Declaration that it's public domain):
38+ * http://groups.google.com/group/comp.lang.c/msg/7c7b39328fefab9c
39+ */
40+
41+ char * strtok_r (char * str , const char * delim , char * * nextp )
42+ {
43+ char * ret ;
44+
45+ if (str == NULL )
46+ str = * nextp ;
47+
48+ str += strspn (str , delim );
49+
50+ if (* str == '\0' )
51+ return NULL ;
52+
53+ ret = str ;
54+ str += strcspn (str , delim );
55+
56+ if (* str )
57+ * str ++ = '\0' ;
58+
59+ * nextp = str ;
60+
61+ return ret ;
62+ }
3063#else
3164# include <sys/socket.h>
3265# include <netinet/in.h>
You can’t perform that action at this time.
0 commit comments