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

Re: PATCH: 3.1.6-pws-4: backreferences



Peter Stephenson wrote:
> - Really stringy strings are now optimized during pattern compilation, not
> just execution: if there is no remaining token after remnulargs(), normal
> compilation is skipped and the string saved as it is.

Oops.  This was slightly overoptimised, removing the ability of stringy
filename path segments to approximate or case-desensitize.
(e.g. (#a1)tst/ac failed to match tst/ab).

--- Src/pattern.c.pat2	Tue Sep 14 15:07:09 1999
+++ Src/pattern.c	Wed Sep 15 09:35:12 1999
@@ -338,11 +338,12 @@
 
     if (!(patflags & PAT_ANY)) {
 	/* Look for a really pure string, with no tokens at all. */
-	for (strp = exp; *strp &&
-		 (!(patflags & PAT_FILE) || *strp != '/') && !itok(*strp);
-	     strp++)
-	    ;
-	if (*strp && *strp != '/') {
+	if (!patglobflags)
+	    for (strp = exp; *strp &&
+		     (!(patflags & PAT_FILE) || *strp != '/') && !itok(*strp);
+		 strp++)
+		;
+	if (!strp || (*strp && *strp != '/')) {
 	    /* No, do normal compilation. */
 	    strp = NULL;
 	    if (patcompswitch(0, &flags) == 0)

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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