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

PATCH: */* broken (Re: PATCH: 3.1.5: ``***'' symlink follow broken)



On Nov 13,  5:59pm, Geoff Wing wrote:
} Subject: Re: PATCH: 3.1.5: ``***'' symlink follow broken
}
} I've got a much better patch for it now.   Just above the line ``if (dirs) {''
} put ``#if 0''  and after the closing brace for it, put "#endif"

Here's a patch that makes the code similar (not identical, there are other
changes that had to be kept) to the 3.0.5 version of the same section.

Index: Src/glob.c
===================================================================
--- glob.c	1998/11/12 17:56:26	1.8
+++ glob.c	1998/11/13 17:06:09
@@ -355,21 +355,12 @@
 	    insert(c->str, 0);
     } else {
 	/* Do pattern matching on current path section. */
-	char *fn;
+	char *fn = pathbuf[pathbufcwd] ? unmeta(pathbuf + pathbufcwd) : ".";
 	int dirs = !!q->next;
-	DIR *lock;
+	DIR *lock = opendir(fn);
 	char *subdirs = NULL;
 	int subdirlen = 0;
 
-	fn = pathbuf[pathbufcwd] ? unmeta(pathbuf + pathbufcwd) : ".";
-	if (dirs) {
-	    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)
-		return;
-	}
-	lock = opendir(fn);
 	if (lock == NULL)
 	    return;
 	while ((fn = zreaddir(lock, 1)) && !errflag) {

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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