From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 900 invoked from network); 30 Oct 2008 20:22:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Oct 2008 20:22:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 2552 invoked from network); 30 Oct 2008 20:22:26 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Oct 2008 20:22:26 -0000 Received: (qmail 29848 invoked by alias); 30 Oct 2008 20:22:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25972 Received: (qmail 29830 invoked from network); 30 Oct 2008 20:22:14 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 30 Oct 2008 20:22:14 -0000 Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id 00C0C80524C0 for ; Thu, 30 Oct 2008 21:22:10 +0100 (CET) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20081030202210.ECCZ13155.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Thu, 30 Oct 2008 20:22:10 +0000 Received: from pws-pc ([81.107.43.40]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20081030202210.SFBI2093.aamtaout03-winn.ispmail.ntl.com@pws-pc> for ; Thu, 30 Oct 2008 20:22:10 +0000 Date: Thu, 30 Oct 2008 20:21:58 +0000 From: Peter Stephenson To: Zsh workers Subject: Re: completion matching problem with 4.3.8 Message-ID: <20081030202158.5692e313@pws-pc> In-Reply-To: <19187.1225381420@thecus> References: <24068.1225366130@thecus> <20081030121715.0f3959b5@news01> <1607.1225372412@thecus> <20081030141153.5c53405f@news01> <18981.1225379134@thecus> <19187.1225381420@thecus> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=vpNQ4glSNfQA:10 a=2HVltibiJvcA:10 a=NLZqzBF-AAAA:8 a=USofuCSmOjWcWJGZGTsA:9 a=qureUaqm074CNttxoCsA:7 a=TNX7Vuuddp3HHxLCSpw6a2tWfOAA:4 a=VkNj9pNNdSIA:10 a=-hJg1tCh9CgA:10 a=_dQi-Dcv4p4A:10 a=LY0hPdMaydYA:10 X-Virus-Scanned: ClamAV 0.92.1/8544/Thu Oct 30 19:59:19 2008 on bifrost X-Virus-Status: Clean On Thu, 30 Oct 2008 16:43:40 +0100 Oliver Kiddle wrote: > Anyway, the gcc built zsh also has the problem so it isn't compiler > related. I tried running the minimal zsh -f, compctl test on Linux > through valgrind and I get the following message. Maybe valgrind has > found the source of the problem: >... > Valgrind also finds some leaked memory from parse_class (complete.c:467) > with the same test. This should keep valgrind happy. I can't see any way these changes can be wrong, but I've said that before. Unfortunately, when I do this, the original problem (showing too many characters in an ambiguous completion) now crops up. This will take *massively* more time to fix than the hour and a half I've spent so far. Index: Src/Zle/complete.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v retrieving revision 1.42 diff -u -r1.42 complete.c --- Src/Zle/complete.c 23 Sep 2008 19:33:26 -0000 1.42 +++ Src/Zle/complete.c 30 Oct 2008 20:14:21 -0000 @@ -464,7 +464,7 @@ * As the input string is metafied, but shouldn't contain shell * tokens, we can just add our own tokens willy nilly. */ - optr = p->u.str = zalloc((optr-iptr) + 1); + optr = p->u.str = zhalloc((optr-iptr) + 1); while (firsttime || *iptr != endchar) { int ch; Index: Src/Zle/compmatch.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v retrieving revision 1.59 diff -u -r1.59 compmatch.c --- Src/Zle/compmatch.c 12 Oct 2008 19:28:10 -0000 1.59 +++ Src/Zle/compmatch.c 30 Oct 2008 20:14:22 -0000 @@ -1687,6 +1687,7 @@ llen = mp->llen; rl = 0; + *line = '\0'; if (sfx) { /* -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/