Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 3.1.2 beta bug

> I am experiencing the following anomaly from zsh 3.1.2 running under
> IRIX: filename glob patterns which encompass multiple directories fail to
> generate any filenames on the IRIX hwfgs filesystem.  This is the
> filesystem which maps hardware devices to files and directories; there
> is no such problem on the "normal" xfs filesystem.

As an experiment, 3.1.2 has leaf optimization.  It is assumed that a
directory has no subdirectories if a directory has a link count less than
2.  This optimization is also used by GNU find as I know.  Too bad that
it does not work, since it can speed up some searches a lot (especially
**/file type pattern globs).  Maybe a test for nlink == 2 instead of <= 2
would help.  A filesystem without the usual Unix directory link count
semantics would probably have link count 1 for directories.

Try this patch.


--- glob.c	1997/06/02 04:19:48
+++ glob.c	1997/07/21 19:46:42
@@ -364,7 +364,7 @@
 	    struct stat st;
 	    stat(fn, &st);
 	    /* a directory with subdirectories has link count greater than 2 */
-	    if (!S_ISDIR(st.st_mode) || st.st_nlink <= 2)
+	    if (!S_ISDIR(st.st_mode) || st.st_nlink == 2)
 	lock = opendir(fn);

Messages sorted by: Reverse Date, Date, Thread, Author