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

NEWS
ext/standard/dir.c

diff --git a/NEWS b/NEWS
index 3ecb022e8c78fe5fe6098551b61895dfb51ee7a8..704649221377dae01ae61569e4a737e06abbe83a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,8 @@ PHP 4                                                                      NEWS
 - Fixed crash bug when non-existing save/serializer handler was used. (Jani)
 - Fixed memory leak in gethostbynamel() if an error occurs. (Sara)
 - Fixed FastCGI being unable to bind to a specific IP. (Sascha)
-- Fixed bug #25583 (Incorrect handling of absolute path without drive). (Ilia)
+- Fixed bug #25583 (Incorrect handling of paths starting with / on win32 
+  inside glob() function). (Ilia)
 - Fixed bug #25570 (Possible crash in apache2handler when zend_bailout called
   outside of zend_try {} block). (Ilia)
 - Fixed bug #25530 (checkdate() incorrectly handles floats). (Ilia)
index 13d4ecc291302894cd3b9e7eaeea909b7113d62c..bfec94618ed20a6944253e27a667e9d4eb746b6e 100644 (file)
@@ -371,6 +371,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;
        }