zsh-workers
 help / color / mirror / code / Atom feed
* Another globbing problem
@ 1999-09-03 23:58 Tanaka Akira
  1999-09-06  8:10 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Tanaka Akira @ 1999-09-03 23:58 UTC (permalink / raw)
  To: zsh-workers

Z(2):akr@is27e1u11% Src/zsh -f
is27e1u11% setopt extendedglob
is27e1u11% echo ./*
./CVS ./ChangeLog ./ChangeLog.3.0 ./Completion ./Config ./Doc ./Etc ./Functions ./INSTALL ./META-FAQ ./Makefile ./Makefile.in ./Misc ./README ./Src ./StartupFiles ./Util ./acconfig.h ./aclocal.m4 ./aczsh.m4 ./config.cache ./config.guess ./config.h ./config.h.in ./config.log ./config.status ./config.sub ./configure ./configure.in ./install-sh ./mkinstalldirs ./stamp-h ./stamp-h.in ./status
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 ./Util ./acconfig.h ./aclocal.m4 ./aczsh.m4 ./config.cache ./config.guess ./config.h ./config.h.in ./config.log ./config.status ./config.sub ./configure ./configure.in ./install-sh ./mkinstalldirs ./stamp-h ./stamp-h.in ./status

zsh-3.1.6-pws-2 works well, but my 3.1.6-pws-2+ doesn't.
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Another globbing problem
  1999-09-03 23:58 Another globbing problem Tanaka Akira
@ 1999-09-06  8:10 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1999-09-06  8:10 UTC (permalink / raw)
  To: Zsh hackers list

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 <pws@ifh.de>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-06  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-03 23:58 Another globbing problem Tanaka Akira
1999-09-06  8:10 ` Peter Stephenson

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).