From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 413 invoked from network); 13 Nov 1998 17:18:14 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 13 Nov 1998 17:18:14 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id MAA15290; Fri, 13 Nov 1998 12:17:00 -0500 (EST) Resent-Date: Fri, 13 Nov 1998 12:17:00 -0500 (EST) From: "Bart Schaefer" Message-Id: <981113091530.ZM17187@candle.brasslantern.com> Date: Fri, 13 Nov 1998 09:15:30 -0800 In-Reply-To: <19981113175933.A18622@primenet.com.au> Comments: In reply to Geoff Wing "Re: PATCH: 3.1.5: ``***'' symlink follow broken" (Nov 13, 5:59pm) References: <19981112172055.A21356@primenet.com.au> <19981113175933.A18622@primenet.com.au> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Zsh Hackers Subject: PATCH: */* broken (Re: PATCH: 3.1.5: ``***'' symlink follow broken) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"G2Q55.0.ok3.Cc6Js"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4624 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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