From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16834 invoked from network); 6 Sep 1999 08:11:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Sep 1999 08:11:27 -0000 Received: (qmail 19454 invoked by alias); 6 Sep 1999 08:10:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7649 Received: (qmail 19445 invoked from network); 6 Sep 1999 08:10:27 -0000 Message-Id: <199909060810.KAA342356@hydra.ifh.de> X-Authentication-Warning: hydra.ifh.de: pws owned process doing -bs To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: Another globbing problem In-reply-to: "Tanaka Akira"'s message of "04 Sep 1999 08:58:24 MET DST." Date: Mon, 06 Sep 1999 10:10:21 +0200 From: Peter Stephenson Tanaka Akira wrote: > is27e1u11% echo ./*~./ChangeLog > zsh: no matches found: ./*~./ChangeLog > > This should be: > > is27e1u11% echo ./*~./ChangeLog > ./CVS ./ChangeLog.3.0 ./Completion ./Config ./Doc ./Etc ./Functions ./INSTALL > ./META-FAQ ./Makefile ./Makefile.in ./Misc ./README ./Src ./StartupFiles ./U > til ./acconfig.h ./aclocal.m4 ./aczsh.m4 ./config.cache ./config.guess ./conf > ig.h ./config.h.in ./config.log ./config.status ./config.sub ./configure ./co > nfigure.in ./install-sh ./mkinstalldirs ./stamp-h ./stamp-h.in ./status I forgot to update the special case for a top-level ~ in globbing to use the end character arrays. --- Src/pattern.c~ Thu Sep 2 10:22:55 1999 +++ Src/pattern.c Mon Sep 6 09:26:06 1999 @@ -427,7 +427,7 @@ #ifdef BACKREFERENCES int parno = 0; #endif - int flags, gfchanged = 0, savflags = patflags, savglobflags = patglobflags; + int flags, gfchanged = 0, savglobflags = patglobflags; Upat ptr; *flagp = 0; @@ -491,8 +491,13 @@ up.p = NULL; patadd((char *)&up, 0, sizeof(up), 0); /* / is not treated as special if we are at top level */ - if (!paren) - patflags &= ~PAT_FILE; + if (!paren && *patendseg == '/') { + tilde++; + patendseg++; + patendseglen--; + patendstr++; + patendstrlen--; + } } else { excsync = 0; br = patnode(P_BRANCH); @@ -529,7 +534,13 @@ } } newbr = patcompbranch(&flags); - patflags = savflags; + if (tilde == 2) { + /* restore special treatment of / */ + patendseg--; + patendseglen++; + patendstr--; + patendstrlen++; + } if (!newbr) return 0; if (gfnode) -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy