summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-10-03 15:05:50 +0000
committerAndi Gutmans <andi@php.net>2000-10-03 15:05:50 +0000
commit18f86e7757ec450e73fbc6ffa339f78e56ab0214 (patch)
treeb068305c05a91b07a961e1c5e57f4d7bd43e8284 /main
parentd37b1406010e355d138ca7815319acd1adc435f9 (diff)
downloadphp-git-18f86e7757ec450e73fbc6ffa339f78e56ab0214.tar.gz
- Fix V_CHDIR_FILE() to only chdir() when a directory part is specified.
Use this instead of broken php_dirname() in fopen-wrappers.c
Diffstat (limited to 'main')
-rw-r--r--main/fopen_wrappers.c10
1 files changed, 2 insertions, 8 deletions
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;