zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Zsh Hackers <zsh-workers@math.gatech.edu>
Subject: PATCH: */* broken (Re: PATCH: 3.1.5: ``***'' symlink follow broken)
Date: Fri, 13 Nov 1998 09:15:30 -0800	[thread overview]
Message-ID: <981113091530.ZM17187@candle.brasslantern.com> (raw)
In-Reply-To: <19981113175933.A18622@primenet.com.au>

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


  reply	other threads:[~1998-11-13 17:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-12  6:20 PATCH: 3.1.5: ``***'' symlink follow broken Geoff Wing
1998-11-12 10:04 ` Bart Schaefer
1998-11-12 14:10 ` Peter Stephenson
1998-11-12 14:58   ` Bruce Stephens
1998-11-12 17:21   ` Bart Schaefer
1998-11-13  8:55     ` Peter Stephenson
1998-11-13  6:59 ` Geoff Wing
1998-11-13 17:15   ` Bart Schaefer [this message]
1998-11-14 12:38     ` PATCH: */* broken (Re: PATCH: 3.1.5: ``***'' symlink follow broken) Geoff Wing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=981113091530.ZM17187@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).