fixed pyargv

This commit is contained in:
roberto@debian64
2012-02-02 11:14:34 +01:00
parent b8c17baf7c
commit 1a0161cb6b
+5 -2
View File
@@ -72,18 +72,21 @@ void init_pyargv() {
#endif
up.argc = 1;
char *tmp_ptr = uwsgi_str(up.argv);
#ifdef __sun__
// FIX THIS !!!
ap = strtok(up.argv, " ");
ap = strtok(tmp_ptr, " ");
while ((ap = strtok(NULL, " ")) != NULL) {
#else
while ((ap = strsep(&up.argv, " \t")) != NULL) {
while ((ap = strsep(&tmp_ptr, " \t")) != NULL) {
#endif
if (*ap != '\0') {
up.argc++;
}
}
free(tmp_ptr);
#ifdef PYTHREE
up.py_argv = uwsgi_calloc(sizeof(wchar_t *) * up.argc+1);
#else