]> granicus.if.org Git - php/commitdiff
Fixed bug #25583 (Incorrect handling of paths starting with / on win32
authorIlia Alshanetsky <iliaa@php.net>
Sat, 20 Sep 2003 02:51:20 +0000 (02:51 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 20 Sep 2003 02:51:20 +0000 (02:51 +0000)
inside glob() function).

ext/standard/dir.c

index 40bb238a382111167556f8f784d3ab91c7953b08..40738b3b8eef71fd0ccc8704b300a3a88238fbd0 100644 (file)
@@ -373,6 +373,11 @@ PHP_FUNCTION(glob)
                        cwd[0] = '\0';
                }
                cwd_skip = strlen(cwd)+1;
+#ifdef PHP_WIN32
+               if (IS_SLASH(cwd[0]) && !IS_UNC_PATH(pattern, pattern_len)) {
+                       cwd[2] = '\0';
+               }
+#endif
                snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
                pattern = work_pattern;
        }