zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: ** in match specs
Date: Thu, 30 Mar 2000 12:40:25 +0200 (MET DST)	[thread overview]
Message-ID: <200003301040.MAA29203@beta.informatik.hu-berlin.de> (raw)


I knew trouble would come of that...

  compdef foo foo
  foo() { compadd -M 'r:|.=** r:|=*' test.old.ps test.ps }

And trying `foo t.p<TAB>' removed the `p'. This should fix it.

Bye
 Sven

diff -ru ../z.old/Src/Zle/compmatch.c Src/Zle/compmatch.c
--- ../z.old/Src/Zle/compmatch.c	Thu Mar 30 09:58:19 2000
+++ Src/Zle/compmatch.c	Thu Mar 30 11:55:18 2000
@@ -1699,7 +1699,7 @@
 	*p = e->prefix;
 	ca = a->prefix;
 
-	while (n != op) {
+	while (n) {
 	    e->prefix = cp_cline(n, 0);
 	    a->prefix = cp_cline(ca, 0);
 
@@ -1721,6 +1721,8 @@
 	    min -= n->min;
 	    max -= n->max;
 
+	    if (n == op)
+		break;
 	    n = n->next;
 	}
     }
@@ -1761,7 +1763,10 @@
 		    t->next = NULL;
 		    free_cline(o);
 		    o = tn;
-		    o->flags |= CLF_MISS;
+		    if (po)
+			po->flags |= CLF_MISS;
+		    else
+			o->flags |= CLF_MISS;
 		    continue;
 		}
 	    }
@@ -1773,7 +1778,10 @@
 		    sub_join(o, n, tn, 0);
 
 		    n = tn;
-		    o->flags |= CLF_MISS;
+		    if (po)
+			po->flags |= CLF_MISS;
+		    else
+			o->flags |= CLF_MISS;
 		    continue;
 		}
 	    }
@@ -1832,7 +1840,15 @@
 		    sub_join(o, n, tn, 0);
 
 		    n = tn;
-		    o->flags |= CLF_MISS;
+		    if (po)
+			po->flags |= CLF_MISS;
+		    else
+			o->flags |= CLF_MISS;
+
+		    po = o;
+		    o = o->next;
+		    pn = n;
+		    n = n->next;
 		    continue;
 		} else {
 		    for (t = o; (tn = t->next) && !cmp_anchors(n, tn, 1);
@@ -1846,7 +1862,10 @@
 			else
 			    oo = tn;
 			o = tn;
-			o->flags |= CLF_MISS;
+			if (po)
+			    po->flags |= CLF_MISS;
+			else
+			    o->flags |= CLF_MISS;
 			continue;
 		    } else {
 			if (o->flags & CLF_SUF)

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-03-30 10:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-30 10:40 Sven Wischnowsky [this message]
2000-03-30 14:42 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200003301040.MAA29203@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).