hholzgra Tue Jun 3 07:01:16 2003 EDT
Modified files:
/php4/ext/standard dir.c
Log:
handle return value for "no matches" on systems that don't return
GLOB_NOMATCH consistent to those that do (return array(), not FALSE)
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.118 php4/ext/standard/dir.c:1.119
--- php4/ext/standard/dir.c:1.118 Mon May 5 08:17:02 2003
+++ php4/ext/standard/dir.c Tue Jun 3 07:01:16 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.118 2003/05/05 12:17:02 thies Exp $ */
+/* $Id: dir.c,v 1.119 2003/06/03 11:01:16 hholzgra Exp $ */
/* {{{ includes/startup/misc */
@@ -400,11 +400,16 @@
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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php