]> granicus.if.org Git - php/commitdiff
Fixed bug #28289 (incorrect resolving of relative paths by glob() in
authorIlia Alshanetsky <iliaa@php.net>
Sun, 9 May 2004 19:01:13 +0000 (19:01 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 9 May 2004 19:01:13 +0000 (19:01 +0000)
windows).

ext/standard/dir.c

index 0d9bdfb90bf63b29473bf9f42845bae9222cb09b..4609d15d67ca813d3d700113af06a816f3fd76dc 100644 (file)
@@ -379,11 +379,13 @@ PHP_FUNCTION(glob)
                if (!result) {
                        cwd[0] = '\0';
                }
-               cwd_skip = strlen(cwd)+1;
 #ifdef PHP_WIN32
-               if (IS_SLASH(cwd[0]) && !IS_UNC_PATH(pattern, pattern_len)) {
+               if (!IS_SLASH(cwd[0])) {
                        cwd[2] = '\0';
+                       cwd_skip = 3;
                }
+#else
+               cwd_skip = strlen(cwd)+1;
 #endif
                snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
                pattern = work_pattern;