projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69ba485
)
Slightly improved version of mystrtok_r
author
kwolekr
<mirrorisim@gmail.com>
Wed, 23 Jan 2013 22:37:53 +0000
(17:37 -0500)
committer
kwolekr
<mirrorisim@gmail.com>
Wed, 23 Jan 2013 22:37:53 +0000
(17:37 -0500)
src/util/string.cpp
patch
|
blob
|
history
diff --git
a/src/util/string.cpp
b/src/util/string.cpp
index 481e74dad98fd6dd43c74dd08bb2dc1e95a42499..c10755ae1dba68d47c314ab9821ead0d06bbb54b 100644
(file)
--- a/
src/util/string.cpp
+++ b/
src/util/string.cpp
@@
-50,7
+50,6
@@
size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata) {
char *mystrtok_r(char *s, const char *sep, char **lasts) {
char *t;
- int delim_reached;
if (!s)
s = *lasts;
@@
-61,15
+60,11
@@
char *mystrtok_r(char *s, const char *sep, char **lasts) {
if (!*s)
return NULL;
- delim_reached = 0;
t = s;
while (*t) {
if (strchr(sep, *t)) {
- *t = '\0';
- delim_reached = 1;
- } else if (delim_reached) {
- *lasts = t;
- return s;
+ *t++ = '\0';
+ break;
}
t++;
}