From: Andi Gutmans Date: Thu, 29 Jun 2000 13:31:52 +0000 (+0000) Subject: - Fix problem with DICARD_PATH being defined in windows X-Git-Tag: PRE_METHOD_CALL_SEPERATE_FIX_PATCH~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f828a6e8820f6f5c6abc9833308aafd488b10fd;p=php - Fix problem with DICARD_PATH being defined in windows --- diff --git a/main/config.w32.h b/main/config.w32.h index d60f17e5ea..30b232b2b0 100644 --- a/main/config.w32.h +++ b/main/config.w32.h @@ -113,7 +113,7 @@ DONT TOUCH!!!!! Unless you realy know what your messing with! ---------------------------------------------------------------*/ -#define DISCARD_PATH 1 +#define DISCARD_PATH 0 #undef HAVE_SETITIMER #undef HAVE_IODBC #define HAVE_UODBC 1 diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index f3b91f0ffe..306f6b96d1 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -489,7 +489,10 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine zend_llist_init(&global_vars, sizeof(char *), NULL, 0); if (!cgi) { /* never execute the arguments if you are a CGI */ - SG(request_info).argv0 = NULL; + if (!SG(request_info).argv0) { + free(SG(request_info).argv0); + SG(request_info).argv0 = NULL; + } while ((c = ap_php_getopt(argc, argv, "c:d:z:g:qvisnaeh?vf:")) != -1) { switch (c) { case 'f': @@ -630,6 +633,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine SG(request_info).path_translated = estrdup(getenv("SCRIPT_FILENAME")); #else SG(request_info).path_translated = estrdup(getenv("PATH_TRANSLATED")); + #endif } if (cgi || SG(request_info).path_translated) {