]> granicus.if.org Git - php/commitdiff
- Fix V_CHDIR_FILE() to only chdir() when a directory part is specified.
authorAndi Gutmans <andi@php.net>
Tue, 3 Oct 2000 15:05:50 +0000 (15:05 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 3 Oct 2000 15:05:50 +0000 (15:05 +0000)
  Use this instead of broken php_dirname() in fopen-wrappers.c

main/fopen_wrappers.c

index 7fdbca2c8eb8cd20d88ecbe2795ffe76346bd576..18e74ec3c73478acb96c5745c15d0faaf0fd95a8 100644 (file)
@@ -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;