From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4568 invoked from network); 18 Feb 1999 14:55:37 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Feb 1999 14:55:37 -0000 Received: (qmail 24288 invoked by alias); 18 Feb 1999 14:55:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5418 Received: (qmail 24273 invoked from network); 18 Feb 1999 14:55:00 -0000 Date: Thu, 18 Feb 1999 15:53:54 +0100 (MET) Message-Id: <199902181453.PAA08362@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: completion fixes There was a little memory freeing problem (with the list of free cline structs, if anyone knows what I'm talking about...). Also, in addmatches() (a.k.a. almost compadd) the suffix-calculation could fail when used without matching. Bye Sven --- os/Zle/zle_tricky.c Thu Feb 18 10:01:27 1999 +++ Src/Zle/zle_tricky.c Thu Feb 18 15:40:36 1999 @@ -2716,6 +2716,8 @@ Cline f = freecl, q, op = NULL; int ol, nl; + freecl = NULL; + while (o && n) { /* CLF_MID is set in the cline struct where the prefix and the * suffix from the line meet. If we have reached the cline @@ -3777,7 +3779,7 @@ char *suf, char *group, char *rems, char *remf, char *ign, int flags, int aflags, Cmatcher match, char **argv) { - char *s, *t, *e, *te, *ms, *lipre = NULL, *lpre, *lsuf, **aign = NULL; + char *s, *t, *e, *me, *te, *ms, *lipre = NULL, *lpre, *lsuf, **aign = NULL; int lpl, lsl, i, pl, sl, test, bpl, bsl, lsm, llpl; Aminfo ai; Cline lc = NULL; @@ -3881,6 +3883,7 @@ /* Walk through the matches given. */ for (; (s = dupstring(*argv)); argv++) { sl = strlen(s); + lc = NULL; ms = NULL; bpl = brpl; bsl = brsl; @@ -3917,9 +3920,10 @@ test = 1; if (!test) continue; - e = s + sl; + me = e = s + sl; } else { e = s; + me = s + sl; pl = lpl; } /* Quoting? */ @@ -3941,7 +3945,7 @@ t = dyncat(ppre, t); if (!ms && mstack) { Cline *clp = &lc, tlc; - char *ss = dupstring(s), *ee = e + (ss - s); + char *ss = dupstring(s), *ee = me + (ss - s); if (lppre && *lppre) { *clp = str_cline(lppre, strlen(lppre), &tlc); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de