From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14273 invoked from network); 18 Sep 2008 20:33:45 -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; 18 Sep 2008 20:33:45 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 31138 invoked from network); 18 Sep 2008 20:33:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Sep 2008 20:33:37 -0000 Received: (qmail 12546 invoked by alias); 18 Sep 2008 20:33:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25690 Received: (qmail 12535 invoked from network); 18 Sep 2008 20:33:30 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 Sep 2008 20:33:30 -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 5FA32802720D for ; Thu, 18 Sep 2008 22:33:27 +0200 (CEST) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20080918203326.PBN21103.mtaout02-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Thu, 18 Sep 2008 21:33:26 +0100 Received: from pws-pc ([81.107.43.40]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20080918203326.JXD19289.aamtaout02-winn.ispmail.ntl.com@pws-pc> for ; Thu, 18 Sep 2008 21:33:26 +0100 Date: Thu, 18 Sep 2008 21:33:22 +0100 From: Peter Stephenson To: zsh-workers Subject: Re: weird history bug (involves unicode characters) Message-ID: <20080918213322.6a3b7c58@pws-pc> In-Reply-To: <237967ef0809180515p784beb03ud7a78129089c4e2c@mail.gmail.com> References: <237967ef0809180515p784beb03ud7a78129089c4e2c@mail.gmail.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Cloudmark-Analysis: v=1.0 c=1 a=nvvSfVuDH8gA:10 a=zL9gzTbeKOQA:10 a=NLZqzBF-AAAA:8 a=oVbZ_lI7kXP0UEHflfcA:9 a=NqzuDFJzsfWuPmBexxYA:7 a=7PdFPkWLYUiXZcpMDlY9OiLApW0A:4 a=MSl-tDqOz04A:10 a=_dQi-Dcv4p4A:10 a=LY0hPdMaydYA:10 X-Virus-Scanned: ClamAV 0.92.1/8282/Thu Sep 18 20:21:01 2008 on bifrost X-Virus-Status: Clean On Thu, 18 Sep 2008 14:15:12 +0200 "Mikael Magnusson" wrote: > zsh -f > : =E3=83=88 > > #this brings back the =E3=83=88 > > >=20 > only the colon appears, and alt-. also stops working completely I can't work out why no one else sees these problems... I should never have made stringaszleline() modify the string in place. It was supposed to be more efficient but I keep forgetting. I should perhaps make it a flag which should be enough to remind me. Index: Src/Zle/zle_hist.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_hist.c,v retrieving revision 1.57 diff -u -r1.57 zle_hist.c --- Src/Zle/zle_hist.c 11 May 2008 18:37:35 -0000 1.57 +++ Src/Zle/zle_hist.c 18 Sep 2008 20:31:08 -0000 @@ -599,7 +599,7 @@ =20 static char *lastinsert; static int lasthist, lastpos, lastlen; - int evhist, save; + int evhist; =20 /* * If we have at least one argument, the first is the history @@ -722,10 +722,9 @@ t =3D he->node.nam + he->words[2*n-1]; } =20 - save =3D *t; - *t =3D '\0'; /* ignore trailing whitespace */ lasthist =3D evhist; lastpos =3D zlemetacs; + /* ignore trailing whitespace */ lastlen =3D t - s; lastinsert =3D zalloc(t - s); memcpy(lastinsert, s, lastlen); @@ -734,11 +733,10 @@ =20 unmetafy_line(); =20 - zs =3D stringaszleline(s, 0, &len, NULL, NULL); + zs =3D stringaszleline(dupstrpfx(s, t - s), 0, &len, NULL, NULL); doinsert(zs, len); free(zs); zmult =3D n; - *t =3D save; return 0; } =20 --=20 Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/