From: Ilia Alshanetsky Date: Mon, 7 Jun 2004 18:30:16 +0000 (+0000) Subject: Fixed bug #28668 (glob() does not work with relative paths on Windows). X-Git-Tag: php-5.0.0~259 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ceb70dbc681df1f5bde7cdc296176fd5734b8312;p=php Fixed bug #28668 (glob() does not work with relative paths on Windows). --- diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 9a3c1c87be..9642c93781 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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; }