From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1913 invoked from network); 30 Mar 2000 10:40:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Mar 2000 10:40:49 -0000 Received: (qmail 14725 invoked by alias); 30 Mar 2000 10:40:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10329 Received: (qmail 14712 invoked from network); 30 Mar 2000 10:40:38 -0000 Date: Thu, 30 Mar 2000 12:40:25 +0200 (MET DST) Message-Id: <200003301040.MAA29203@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: ** in match specs 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' 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