summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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';
}
}