iliaa Wed Jul 23 17:41:44 2003 EDT
Modified files:
/php-src/ext/standard dir.c
Log:
Fixed GLOB_ONLYDIR to work on GNU libc based system.
Index: php-src/ext/standard/dir.c
diff -u php-src/ext/standard/dir.c:1.125 php-src/ext/standard/dir.c:1.126
--- php-src/ext/standard/dir.c:1.125 Mon Jul 14 12:23:14 2003
+++ php-src/ext/standard/dir.c Wed Jul 23 17:41:44 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.125 2003/07/14 16:23:14 sniper Exp $ */
+/* $Id: dir.c,v 1.126 2003/07/23 21:41:44 iliaa Exp $ */
/* {{{ includes/startup/misc */
@@ -413,7 +413,14 @@
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
-#ifdef GLOB_EMULATE_ONLYDIR
+ /* we need to this everytime since GLOB_ONLYDIR does not guarantee that
+ * all directories will be filtered. GNU libc documentation states the
+ * following:
+ * If the information about the type of the file is easily available
+ * non-directories will be rejected but no extra work will be done to
+ * determine the information for each file. I.e., the caller must
still be
+ * able to filter directories out.
+ */
if (flags & GLOB_ONLYDIR) {
struct stat s;
@@ -425,7 +432,6 @@
continue;
}
}
-#endif
add_next_index_string(return_value, globbuf.gl_pathv[n]+cwd_skip, 1);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php