From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16367 invoked from network); 20 Jul 2001 10:50:54 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Jul 2001 10:50:54 -0000 Received: (qmail 194 invoked by alias); 20 Jul 2001 10:50:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15433 Received: (qmail 165 invoked from network); 20 Jul 2001 10:50:37 -0000 From: Sven Wischnowsky Date: Fri, 20 Jul 2001 12:50:18 +0200 (MET DST) Message-Id: <200107201050.MAA09449@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: Re: seg fault with completion In-Reply-To: <3B57F8FB.6F42295C@yahoo.co.uk> Oliver Kiddle wrote: > This is in version 4.0.2 too so is not new. > > s=( $a[( ) > cursor positioned where I have put `'. Memory problem and hence not always reproducible. It was using a pointer to compsuffix which might be freed by ignore_suffix(). And that loop shouldn't be using `str' anyway, it's `more' there. This'll go into 4.0.x, too. Bye Sven Index: Src/Zle/computil.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v retrieving revision 1.65 diff -u -r1.65 computil.c --- Src/Zle/computil.c 2001/07/19 08:40:37 1.65 +++ Src/Zle/computil.c 2001/07/20 10:48:53 @@ -2615,19 +2615,21 @@ ign = strlen(as); } } + more = dupstring(more); + if (ign) ignore_suffix(ign); while (more && *more) { - if ((val = cv_next(d, &str, &arg))) { + if ((val = cv_next(d, &more, &arg))) { zaddlinknode(state.vals, ztrdup(val->name)); if (arg) { - if (str) { - char sav = str[-1]; + if (more) { + char sav = more[-1]; - str[-1] = '\0'; + more[-1] = '\0'; zaddlinknode(state.vals, ztrdup(arg)); - str[-1] = sav; + more[-1] = sav; } else { zaddlinknode(state.vals, tricat(arg, compsuffix, "")); nosfx = 1; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de