From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1951 invoked from network); 19 Feb 1999 09:54:23 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Feb 1999 09:54:23 -0000 Received: (qmail 4855 invoked by alias); 19 Feb 1999 09:53:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5424 Received: (qmail 4847 invoked from network); 19 Feb 1999 09:53:45 -0000 Date: Fri, 19 Feb 1999 10:53:02 +0100 (MET) Message-Id: <199902190953.KAA09886@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: fix for compadd without matching This makes addmatches() use the right prefix string when it doesn't do matching. The cline list built was wrong with dire consequences (anything from completely wrong strings to endless loops). Bye Sven --- os/Zle/zle_tricky.c Fri Feb 19 10:03:56 1999 +++ Src/Zle/zle_tricky.c Fri Feb 19 10:49:21 1999 @@ -3924,7 +3924,7 @@ } else { e = s; me = s + sl; - pl = lpl; + pl = sl; } /* Quoting? */ if (!(aflags & CAF_QUOTE)) { @@ -3947,16 +3947,12 @@ Cline *clp = &lc, tlc; char *ss = dupstring(s), *ee = me + (ss - s); - if (lppre && *lppre) { - *clp = str_cline(lppre, strlen(lppre), &tlc); - clp = &(tlc->next); - } - if (pl) { - *clp = str_cline(ss, pl, &tlc); + if (ppre && *ppre) { + *clp = str_cline(ppre, strlen(ppre), &tlc); clp = &(tlc->next); } if (ee != ss + sl || (lpsuf && *lpsuf)) { - *clp = tlc = getcline(ss + pl, (ee - ss) - pl, + *clp = tlc = getcline(ss, ee - ss, NULL, 0, CLF_MID); clp = &(tlc->next); if (ee != ss + sl) { @@ -3968,7 +3964,7 @@ clp = &(tlc->next); } } else { - *clp = tlc = getcline(NULL, 0, ss + pl, sl - pl, + *clp = tlc = getcline(NULL, 0, ss, sl, CLF_END | CLF_VAR); clp = &(tlc->next); } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de