From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2229 invoked from network); 12 May 2009 19:53:12 -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; 12 May 2009 19:53:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 10629 invoked from network); 12 May 2009 19:53:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 May 2009 19:53:08 -0000 Received: (qmail 14673 invoked by alias); 12 May 2009 19:53:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26958 Received: (qmail 14661 invoked from network); 12 May 2009 19:53:03 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 12 May 2009 19:53:03 -0000 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP id F18658028C72 for ; Tue, 12 May 2009 21:52:58 +0200 (CEST) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090512195258.WXFW24913.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Tue, 12 May 2009 20:52:58 +0100 Received: from pws-pc.ntlworld.com ([81.107.42.185]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090512195258.FEML13254.aamtaout01-winn.ispmail.ntl.com@pws-pc.ntlworld.com> for ; Tue, 12 May 2009 20:52:58 +0100 Received: from pws-pc (pws-pc [127.0.0.1]) by pws-pc.ntlworld.com (8.14.3/8.14.2) with ESMTP id n4CJqrsS009859 for ; Tue, 12 May 2009 20:52:53 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: reallocation of prompt X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Tue, 12 May 2009 20:52:53 +0100 Message-ID: <9858.1242157973@pws-pc> X-Cloudmark-Analysis: v=1.0 c=1 a=NLZqzBF-AAAA:8 a=rI3qnBJy2XHHVR6v8EsA:9 a=yzibibNGxyKOu_qLo_wA:7 a=F6hfYBi-jQcwNjKR_pe137MtQEgA:4 a=_dQi-Dcv4p4A:10 X-Virus-Scanned: ClamAV 0.92.1/9355/Tue May 12 19:42:46 2009 on bifrost X-Virus-Status: Clean Bart sent me a valgrind trace of a problem in the prompt code that I've finally run to earth. Index: Src/prompt.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v retrieving revision 1.57 diff -u -r1.57 prompt.c --- Src/prompt.c 24 Oct 2008 10:27:26 -0000 1.57 +++ Src/prompt.c 12 May 2009 19:50:53 -0000 @@ -841,6 +841,7 @@ if((bv->bp - bv->buf) + need > bv->bufspc) { int bo = bv->bp - bv->buf; int bo1 = bv->bp1 ? bv->bp1 - bv->buf : -1; + ptrdiff_t bufline_off = bv->bufline ? bv->bufline - bv->buf : -1; if(need & 255) need = (need | 255) + 1; @@ -848,6 +849,8 @@ bv->bp = bv->buf + bo; if(bo1 != -1) bv->bp1 = bv->buf + bo1; + if (bufline_off != -1) + bv->bufline = bv->buf + bufline_off; } } -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/