]> granicus.if.org Git - php/commitdiff
MFH
authorHartmut Holzgraefe <hholzgra@php.net>
Tue, 3 Jun 2003 11:07:40 +0000 (11:07 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Tue, 3 Jun 2003 11:07:40 +0000 (11:07 +0000)
ext/standard/dir.c

index 11357b8d941a9afaee8c218fedd333204b0d35da..b7947030ce2d98e66ac922717893e16b4a8cb89e 100644 (file)
@@ -398,11 +398,16 @@ PHP_FUNCTION(glob)
                RETURN_FALSE;
        }
 
+#ifndef GLOB_NOMATCH
+       // now catch the FreeBSD style of "no matches"
+       if (!globbuf.gl_pathc) {
+                       array_init(return_value);
+                       return;
+       }
+#endif
+
        /* we assume that any glob pattern will match files from one directory only
           so checking the dirname of the first match should be sufficient */
-       if (!globbuf.gl_pathv) {
-               RETURN_FALSE;
-       }
        strncpy(cwd, globbuf.gl_pathv[0], MAXPATHLEN);
        if (PG(safe_mode) && (!php_checkuid(cwd, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
                RETURN_FALSE;