From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20879 invoked from network); 17 Sep 1999 15:20:13 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Sep 1999 15:20:13 -0000 Received: (qmail 11935 invoked by alias); 17 Sep 1999 15:20:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7921 Received: (qmail 11902 invoked from network); 17 Sep 1999 15:19:59 -0000 Message-Id: <9909171444.AA27649@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Re: _man only uses $manpath In-Reply-To: "Oliver Kiddle"'s message of "Fri, 17 Sep 1999 15:27:32 DFT." <37E24FD4.30CED0F9@u.genie.co.uk> Date: Fri, 17 Sep 1999 16:44:56 +0200 From: Peter Stephenson Oliver Kiddle wrote: > As an aside, can the filename generation below be put all in one word: > it seems that I can't nest brackets with | and can't do things like (|/) > without getting a zsh: bad pattern error. > + manpath=( /usr/man(-/N) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/N) ) If you read the manual, you'll see that / in () isn't supposed to work, with one exception which you can use here --- it's not exactly what you want, because it will match those names to any depth: /(opt|usr)/(dt|share|X11R6|local/)#(cat|)man(-/N) There are actually two problems here. The first is that the test for the existence of a file segment in a closure is bungled. The patch below is supposed to fix this. I can't see how the code as it is can be right. (This wouldn't show up in this case, actually; only in the rare case where you have a fixed string in (.../)#, as I did when testing the following, which is presumably why no-one has ever noticed.) The second is more subtle. (.../)# behaves like **/, not ***/, in that it won't follow links, so if /usr/local is a link (as it is here, which is why I'm writing this at all) it won't be included. That's deliberate, since **/, and not ***/, is the abbreviation for (*/)#. But it's rather inconvenient. I can't think of a really clean fix. --- Src/glob.c.sfp Tue Sep 14 13:43:43 1999 +++ Src/glob.c Fri Sep 17 16:33:47 1999 @@ -476,7 +476,7 @@ if (!errflag && !(q->closure && !strcmp(str, "."))) { addpath(str); - if (!closure || statfullpath("", NULL, 1)) + if (!closure || !statfullpath("", NULL, 1)) scanner((q->closure) ? q : q->next); pathbuf[pathpos = oppos] = '\0'; } -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy