From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25482 invoked from network); 2 Aug 1999 12:37:10 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Aug 1999 12:37:10 -0000 Received: (qmail 11175 invoked by alias); 2 Aug 1999 12:37:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7346 Received: (qmail 11168 invoked from network); 2 Aug 1999 12:37:00 -0000 Date: Mon, 2 Aug 1999 14:36:58 +0200 (MET DST) Message-Id: <199908021236.OAA13350@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Mon, 2 Aug 1999 13:28:06 +0200 (MET DST) Subject: Re: PATCH: Completion/matching control problem Felix Rosencrantz wrote: > Here's a problem with matching control that I encountered. I've been > meaning to send this patch in for some time. If I understood the code > better, I think I provide a cleaner test case. > > mkdir bug > cd bug > touch Abc-Def-Ghij.txt > touch Abc-def.ghi.jkl_mno.pqr.txt > touch Abc_def_ghi_jkl_mno_pqr.txt > compctl -M 'm:{a-z}={A-Z} r:|[.,_-]=*' > ls a-a There was also a problem in join_strs() which could cause an endless loop. And if you have a matcher such as `m:-=[-_]', the string inserted was sometimes not what you'd expect, e.g. after `ls Abc-d' where the `d' was removed. This was caused by the loop in join_clines() which tried to find matching anchors even if the prefixes before the current anchors matched. For now I have just unc-commented that code -- I still like the idea. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Mon Aug 2 13:29:22 1999 +++ Src/Zle/zle_tricky.c Mon Aug 2 14:31:20 1999 @@ -2871,7 +2871,8 @@ *ap += mp->wlen; *alp -= mp->wlen; *bp += bl; *blp -= bl; t = 1; - } + } else + t = 0; } } } @@ -3422,6 +3423,11 @@ } /* Now see if they have matching anchors. If not, cut the list. */ if (!(o->flags & CLF_MID) && !cmp_anchors(o, n, 1)) { +#if 0 + /* This used to search forward for matching anchors. + * Unfortunately this does the wrong thing if the prefixes + * before the differing anchors match nicely. */ + Cline t, tn; for (t = n; (tn = t->next) && !cmp_anchors(o, tn, 1); t = tn); @@ -3430,6 +3436,7 @@ n = tn; continue; } else { +#endif if (o->flags & CLF_SUF) break; @@ -3438,7 +3445,9 @@ free_cline(o->next); o->next = NULL; o->flags |= CLF_MISS; +#if 0 } +#endif } /* Ok, they are equal, now join the sub-lists. */ if (o->flags & CLF_MID) -- Sven Wischnowsky wischnow@informatik.hu-berlin.de