finally removed strtok()

This commit is contained in:
Unbit
2013-09-17 16:03:40 +02:00
parent c14e18b270
commit 373b89e70c
11 changed files with 47 additions and 53 deletions
+6 -4
View File
@@ -320,8 +320,9 @@ void init_pyargv() {
char *tmp_ptr = uwsgi_str(up.argv);
#ifdef __sun__
// FIX THIS !!!
ap = strtok(tmp_ptr, " ");
while ((ap = strtok(NULL, " ")) != NULL) {
char *ctx = NULL;
ap = strtok_r(tmp_ptr, " ", &ctx);
while ((ap = strtok_r(NULL, " ", &ctx)) != NULL) {
#else
while ((ap = strsep(&tmp_ptr, " \t")) != NULL) {
#endif
@@ -352,8 +353,9 @@ void init_pyargv() {
#ifdef __sun__
// FIX THIS !!!
ap = strtok(py_argv_copy, " ");
while ((ap = strtok(NULL, " ")) != NULL) {
char *ctx = NULL;
ap = strtok_r(py_argv_copy, " ", &ctx);
while ((ap = strtok_r(NULL, " ", &ctx)) != NULL) {
#else
while ((ap = strsep(&py_argv_copy, " \t")) != NULL) {
#endif