summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2007-10-09 10:06:34 +0000
committerScott MacVicar <scottmac@php.net>2007-10-09 10:06:34 +0000
commit7deeb54fe1a3146755ae80264798014adbe987a0 (patch)
treeb8cb3fc8bd32e0b0efd56cc729fe28acd445d53f /main
parent6d078cea10ba3982016f6b16b4a74c5851b62849 (diff)
downloadphp-git-7deeb54fe1a3146755ae80264798014adbe987a0.tar.gz
MFH: Fix expand_filepath when including relative files, ideally you should test your code...
Diffstat (limited to 'main')
-rw-r--r--main/fopen_wrappers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 70b07ef8b2..e0122ff152 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -621,8 +621,10 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC)
copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath);
real_path = estrndup(filepath, copy_len);
return real_path;
+ } else {
+ cwd[0] = '\0';
}
- } else {
+ } else if (!result) {
cwd[0] = '\0';
}
}