From: Ilia Alshanetsky Date: Sat, 20 Sep 2003 02:51:20 +0000 (+0000) Subject: Fixed bug #25583 (Incorrect handling of paths starting with / on win32 X-Git-Tag: RELEASE_0_7~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0917a7f62f785e046d902889b443e782106285d4;p=php Fixed bug #25583 (Incorrect handling of paths starting with / on win32 inside glob() function). --- diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 40bb238a38..40738b3b8e 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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; }