summaryrefslogtreecommitdiff
path: root/src/common/strlib.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-30 14:57:36 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-30 14:57:36 +0000
commit8a5388a4807da16705f6a9fcd39b7d50e2716ce7 (patch)
tree3d309aa2972fa936f80674c42a60c6c29a8b0428 /src/common/strlib.c
parent5d2d03817a6db5c1df979aa38941d76d9abed64a (diff)
downloadhercules-8a5388a4807da16705f6a9fcd39b7d50e2716ce7.tar.gz
hercules-8a5388a4807da16705f6a9fcd39b7d50e2716ce7.tar.bz2
hercules-8a5388a4807da16705f6a9fcd39b7d50e2716ce7.tar.xz
hercules-8a5388a4807da16705f6a9fcd39b7d50e2716ce7.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5811 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/strlib.c')
-rw-r--r--src/common/strlib.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 361c693c1..bd2b928c0 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -136,3 +136,36 @@ char *trim(char *str, const char *delim)
strcpy(str,buf);
return str;
}
+
+#ifdef _WIN32
+char *athena_strtok_r (char *s, const char *delim, char **save_ptr)
+{
+ char *token;
+
+ if (s == NULL)
+ s = *save_ptr;
+
+ /* Scan leading delimiters. */
+ s += strspn (s, delim);
+ if (*s == '\0')
+ {
+ *save_ptr = s;
+ return NULL;
+ }
+
+ /* Find the end of the token. */
+ token = s;
+ s = strpbrk (token, delim);
+ if (s == NULL)
+ /* This token finishes the string. */
+ /* *save_ptr = __rawmemchr (token, '\0'); */
+ *save_ptr = token + strlen (token);
+ else
+ {
+ /* Terminate the token and make *SAVE_PTR point past it. */
+ *s = '\0';
+ *save_ptr = s + 1;
+ }
+ return token;
+}
+#endif