From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24031 invoked from network); 24 Feb 2000 09:36:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Feb 2000 09:36:38 -0000 Received: (qmail 6803 invoked by alias); 24 Feb 2000 09:36:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9860 Received: (qmail 6796 invoked from network); 24 Feb 2000 09:36:30 -0000 Date: Thu, 24 Feb 2000 10:36:18 +0100 (MET) Message-Id: <200002240936.KAA18383@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk CC: greg@itasoftware.com (Greg Klanderman) In-reply-to: greg@itasoftware.com's message of Wed, 23 Feb 2000 19:34:25 -0500 (EST) Subject: Re: segfault in 3.1.6 in completion Greg Klanderman wrote: > Start 3.1.6 with no init files and load the below attached completion > functions. Now if you go into a directory containing CVS controlled > files and try > > % cvstest foobar/ > > (where foobar is some directory) and hit TAB you get a crash > > Program received signal SIGSEGV, Segmentation fault. Oops. compctl didn't stay up-to-date with respect to optimised match-storing. And then there was the problem that the display list wasn't stored. Bye Sven diff -ru ../z.old/Src/Zle/compctl.c Src/Zle/compctl.c --- ../z.old/Src/Zle/compctl.c Thu Feb 24 09:54:17 2000 +++ Src/Zle/compctl.c Thu Feb 24 10:32:41 2000 @@ -3763,10 +3763,11 @@ for (ln = firstnode(matches); ln; ln = nextnode(ln)) { m = (Cmatch) getdata(ln); if (m->ppre) { + char *s = (m->psuf ? m->psuf : ""); char *p = (char *) zhalloc(strlen(m->ppre) + strlen(m->str) + - strlen(m->psuf) + 1); + strlen(s) + 1); - sprintf(p, "%s%s%s", m->ppre, m->str, m->psuf); + sprintf(p, "%s%s%s", m->ppre, m->str, s); addlinknode(args, dupstring(p)); } else addlinknode(args, dupstring(m->str)); @@ -3799,6 +3800,9 @@ endcmgroup(yaptr); begcmgroup("default", 0); } + } else { + endcmgroup(yaptr); + begcmgroup("default", 0); } } else if ((tt = cc->explain)) { tt = dupstring(tt); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de