summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/php_virtual_cwd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/php_virtual_cwd.c b/main/php_virtual_cwd.c
index fdb7685db3..5f00e4c2d6 100644
--- a/main/php_virtual_cwd.c
+++ b/main/php_virtual_cwd.c
@@ -345,6 +345,9 @@ CWD_API int virtual_chdir_file(char *path)
return virtual_chdir(path);
}
+ if (length == COPY_WHEN_ABSOLUTE) { /* Also use trailing slash if this is root */
+ length++;
+ }
temp = (char *) malloc(length+1);
memcpy(temp, path, length);
temp[length] = 0;