From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5444 invoked from network); 17 Aug 1999 08:20:48 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Aug 1999 08:20:48 -0000 Received: (qmail 14562 invoked by alias); 17 Aug 1999 08:20:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7441 Received: (qmail 14555 invoked from network); 17 Aug 1999 08:20:27 -0000 Date: Tue, 17 Aug 1999 10:20:25 +0200 (MET DST) Message-Id: <199908170820.KAA08758@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Fri, 13 Aug 1999 14:16:25 +0200 (MET DST) Subject: Re: PATCH: tricky.c and completion functions I wrote: > There was a bug with matching control (it didn't compare the strings > for the anchors on the line and in the word). Here is a fix for another bug: if you have `-M "r:|[-.]=*"' and the matches `a-b.c' and `a.c' doing `a.' removed the dot because it didn't look ahead for matching anchors in both strings (only in one). Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Fri Aug 13 14:16:37 1999 +++ Src/Zle/zle_tricky.c Tue Aug 17 10:15:46 1999 @@ -2147,7 +2147,7 @@ wl = m->llen; w = l; } if (wl) { - /* Probably resie the buffer. */ + /* Probably resize the buffer. */ if (matchbuflen - matchbufadded <= wl) { int blen = matchbuflen + wl + 20; char *buf; @@ -3458,21 +3458,35 @@ for (t = n; (tn = t->next) && !cmp_anchors(o, tn, 1); t = tn); if (tn) { - Cline t; - t = tn->prefix; tn->prefix = n->prefix; n->prefix = t; t = tn->suffix; tn->suffix = n->suffix; n->suffix = t; n = tn; + o->flags |= CLF_MISS; continue; } else { - if (o->flags & CLF_SUF) - break; + for (t = o; (tn = t->next) && !cmp_anchors(n, tn, 1); + t = tn); - o->word = o->line = o->orig = NULL; - o->wlen = 0; - free_cline(o->next); - o->next = NULL; - o->flags |= CLF_MISS; + if (tn) { + t = tn->prefix; tn->prefix = o->prefix; o->prefix = t; + t = tn->suffix; tn->suffix = o->suffix; o->suffix = t; + if (po) + po->next = tn; + else + oo = tn; + o = tn; + o->flags |= CLF_MISS; + continue; + } else { + if (o->flags & CLF_SUF) + break; + + o->word = o->line = o->orig = NULL; + o->wlen = 0; + free_cline(o->next); + o->next = NULL; + o->flags |= CLF_MISS; + } } } /* Ok, they are equal, now join the sub-lists. */ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de