From: Hartmut Holzgraefe Date: Tue, 3 Jun 2003 11:07:40 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.3RC1~112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b8f0741cb4e296bd9076ac67856aa5b35dcfa76;p=php MFH --- diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 11357b8d94..b7947030ce 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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;