From: Andi Gutmans Date: Tue, 3 Oct 2000 15:05:50 +0000 (+0000) Subject: - Fix V_CHDIR_FILE() to only chdir() when a directory part is specified. X-Git-Tag: php-4.0.3RC2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18f86e7757ec450e73fbc6ffa339f78e56ab0214;p=php - Fix V_CHDIR_FILE() to only chdir() when a directory part is specified. Use this instead of broken php_dirname() in fopen-wrappers.c --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 7fdbca2c8e..18e74ec3c7 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -281,7 +281,7 @@ PHPAPI FILE *php_fopen_primary_script(void) { FILE *fp; struct stat st; - char *temp, *path_info, *filename; + char *path_info, *filename; int length; PLS_FETCH(); SLS_FETCH(); @@ -358,13 +358,7 @@ PHPAPI FILE *php_fopen_primary_script(void) STR_FREE(SG(request_info).path_translated); /* for same reason as above */ return NULL; } - - temp = estrdup(filename); - php_dirname(temp, strlen(temp)); - if (*temp) { - V_CHDIR(temp); - } - efree(temp); + V_CHDIR_FILE(filename); SG(request_info).path_translated = filename; return fp;