about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-02-18 00:58:07 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-02-18 00:58:07 +0000
commit441648bf5d1fed6a087affc6dd80c4d604704173 (patch)
treed3184dd4e0c271f74bdff75b152a8c8ad2a662f3
parentaf2ae90d25c362365f8fd82c15e57d22b692cddf (diff)
downloadzsh-441648bf5d1fed6a087affc6dd80c4d604704173.tar.gz
zsh-441648bf5d1fed6a087affc6dd80c4d604704173.tar.xz
zsh-441648bf5d1fed6a087affc6dd80c4d604704173.zip
?## fix from 13497 and site name change from Geoff
-rw-r--r--ChangeLog6
-rw-r--r--Doc/Zsh/metafaq.yo2
-rw-r--r--Src/pattern.c10
3 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index fc64a84d0..7e34501ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-17  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
+
+	* unposted: Doc/Zsh/metafaq.yo: site name change from Geoff.
+
+	* 13497: Src/pattern.c: `?##' didn't work.
+
 2001-02-16  Bart Schaefer  <schaefer@zsh.org>
 
 	* 13495: Follow-up to 13492 to un-break "${(A)=foo=$@}".
diff --git a/Doc/Zsh/metafaq.yo b/Doc/Zsh/metafaq.yo
index d8f3dc4cc..4814606fa 100644
--- a/Doc/Zsh/metafaq.yo
+++ b/Doc/Zsh/metafaq.yo
@@ -42,7 +42,7 @@ item(Finland)(
 nofill(tt(ftp://ftp.funet.fi/pub/unix/shells/zsh/))
 )
 item(France)(
-nofill(tt(ftp://ftp.cenatls.cena.dgac.fr/pub/shells/zsh/))
+nofill(tt(ftp://ftp.cenatls.cena.dgac.fr/shells/zsh/))
 )
 item(Germany)(
 nofill(tt(ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/)  em((H))
diff --git a/Src/pattern.c b/Src/pattern.c
index deb094d5f..db5344230 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -1103,13 +1103,19 @@ patcomppiece(int *flagp)
      * each time we fail on a non-empty branch, we try the empty branch,
      * which is equivalent to backtracking.
      */
-    if ((flags & P_SIMPLE) && op == P_ONEHASH &&
+    if ((flags & P_SIMPLE) && (op == P_ONEHASH || op == P_TWOHASH) &&
 	P_OP((Upat)patout+starter) == P_ANY) {
 	/* Optimize ?# to *.  Silly thing to do, since who would use
 	 * use ?# ? But it makes the later code shorter.
 	 */
 	Upat uptr = (Upat)patout + starter;
-	uptr->l = (uptr->l & ~0xff) | P_STAR;
+	if (op == P_TWOHASH) {
+	    /* ?## becomes ?* */
+	    uptr->l = (uptr->l & ~0xff) | P_ANY;
+	    pattail(starter, patnode(P_STAR));
+	} else {
+	    uptr->l = (uptr->l & ~0xff) | P_STAR;
+	}
     } else if ((flags & P_SIMPLE) && op && !(patglobflags & 0xff)) {
 	/* Don't simplify if we need to look for approximations. */
 	patinsert(op, starter, NULL, 0);