]> granicus.if.org Git - php/commitdiff
Fixed bug #28668 (glob() does not work with relative paths on Windows).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 7 Jun 2004 18:30:16 +0000 (18:30 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 7 Jun 2004 18:30:16 +0000 (18:30 +0000)
ext/standard/dir.c

index 9a3c1c87be2be87db61e4a2550c8b29a41893425..9642c93781ea023b0f92ed0a335047f49d8eef98 100644 (file)
@@ -380,13 +380,12 @@ PHP_FUNCTION(glob)
                        cwd[0] = '\0';
                }
 #ifdef PHP_WIN32
-               if (!IS_SLASH(cwd[0])) {
+               if (IS_SLASH(*pattern)) {
                        cwd[2] = '\0';
-                       cwd_skip = 3;
                }
-#else
-               cwd_skip = strlen(cwd)+1;
 #endif
+               cwd_skip = strlen(cwd)+1;
+
                snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
                pattern = work_pattern;
        }