Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: **/... globbing dots



> Bart Schaefer wrote:
> > On Apr 26,  3:04pm, Paul Ackersviller wrote:
> > > In zsh 3.1.7-pre-1, I notice that **/ is matching directory names startin
> g
> > > with `.' (I have extendedglob on and globdots off, like usual).
> > 
> > I've just reproduced this as far back as 3.1.6-dev-20.  I don't have any
> > older builds around any more.  Glancing through the ChangeLog, I think that
> > makes zsh-workers/10103 the most likely culprit, though I don't see how.

It's not being checked when the pattern code is told to match anything,
which is supposed to be a speedup for recursive globbing.  I put that in
when I rewrote the pattern stuff, so I expect it's been there since mumble.

> Globbing is a big white spot on my zsh-map and after looking what
> happens I still don't know what's going on. For example, it seems to
> read the directory where the **/ is done in twice?

I haven't looked in any detail at anything which doesn't directly call the
pattern code, so I don't know anything about this.

Index: Src/pattern.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/pattern.c,v
retrieving revision 1.5
diff -u -r1.5 pattern.c
--- Src/pattern.c	2000/04/14 11:49:32	1.5
+++ Src/pattern.c	2000/04/27 10:35:37
@@ -1339,6 +1339,8 @@
 	    ((prog->flags & PAT_NOANCH) ? 
 	     !strncmp(progstr, string, prog->patmlen)
 	     : !strcmp(progstr, string))) {
+	    if ((prog->flags & PAT_NOGLD) && *string == '.')
+		return 0;
 	    /* in case used for ${..#..} etc. */
 	    patinput = string + prog->patmlen;
 	    /* if matching files, must update globbing flags */

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author