summaryrefslogtreecommitdiff
path: root/main/fopen_wrappers.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/fopen_wrappers.c')
-rw-r--r--main/fopen_wrappers.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index e4d5688de3..c3646ee0fd 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -505,6 +505,13 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length,
(IS_SLASH(filename[1]) ||
((filename[1] == '.') && IS_SLASH(filename[2])))) ||
IS_ABSOLUTE_PATH(filename, filename_length) ||
+#if PHP_WIN32
+ /* This should count as an absolute local path as well, however
+ IS_ABSOLUTE_PATH doesn't care about this path form till now. It
+ might be a big thing to extend, thus just a local handling for
+ now. */
+ filename_length >=2 && IS_SLASH(filename[0]) && !IS_SLASH(filename[1]) ||
+#endif
!path ||
!*path) {
if (tsrm_realpath(filename, resolved_path)) {
@@ -640,7 +647,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
if ((*filename == '.')
/* Absolute path open */
|| IS_ABSOLUTE_PATH(filename, filename_length)
- || (!path || (path && !*path))
+ || (!path || !*path)
) {
return php_fopen_and_set_opened_path(filename, mode, opened_path);
}