From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15509 invoked from network); 18 Aug 2005 16:35:42 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Aug 2005 16:35:42 -0000 Received: (qmail 15752 invoked from network); 18 Aug 2005 16:35:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Aug 2005 16:35:35 -0000 Received: (qmail 6587 invoked by alias); 18 Aug 2005 16:35:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21663 Received: (qmail 6577 invoked from network); 18 Aug 2005 16:35:32 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Aug 2005 16:35:32 -0000 Received: (qmail 15446 invoked from network); 18 Aug 2005 16:35:32 -0000 Received: from flock1.newmail.ru (212.48.140.157) by a.mx.sunsite.dk with SMTP; 18 Aug 2005 16:35:28 -0000 Received: (qmail 28623 invoked from network); 18 Aug 2005 16:27:48 -0000 Received: from unknown (HELO ?10.0.0.53?) (arvidjaar@newmail.ru@83.237.195.65) by smtpd.newmail.ru with SMTP; 18 Aug 2005 16:27:48 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: crash in completing code with unicode support Date: Thu, 18 Aug 2005 20:35:14 +0400 User-Agent: KMail/1.8.2 References: <237967ef05081518376385563e@mail.gmail.com> <20050816213713.GA5904@blorf.net> <20050816214959.GB5904@blorf.net> In-Reply-To: <20050816214959.GB5904@blorf.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3119316.5ULS3rI9YD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200508182035.15211.arvidjaar@newmail.ru> X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) 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.0.4 --nextPart3119316.5ULS3rI9YD Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 17 August 2005 01:49, Wayne Davison wrote: > On Tue, Aug 16, 2005 at 02:37:13PM -0700, Wayne Davison wrote: > > If the above is right, then this line should probably be changed to be: > > > > if (p =3D=3D compprefix + l + (*compprefix =3D=3D Meta)) > Of course I went blind. The patch adds check for EOS, it intentionally leaves pointer at the end to= =20 let ztrsub() complaint later. Index: Src/Zle/complete.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/complete.c,v retrieving revision 1.29 diff -u -p -r1.29 complete.c =2D-- Src/Zle/complete.c 16 Aug 2005 21:49:33 -0000 1.29 +++ Src/Zle/complete.c 18 Aug 2005 16:30:36 -0000 @@ -821,6 +821,8 @@ do_comp_vars(int test, int na, char *sa, add =3D -1; } else { p =3D compprefix + 1 + (*compprefix =3D=3D Meta); + if (p > compprefix + l) + p =3D compprefix + l; add =3D 1; } for (;;) { @@ -833,10 +835,9 @@ do_comp_vars(int test, int na, char *sa, if (add > 0) { if (p =3D=3D compprefix + l) return 0; =2D if (*p =3D=3D Meta) =2D p +=3D 2; =2D else =2D p++; + p =3D p + 1 + (*p =3D=3D Meta); + if (p > compprefix + l) + p =3D compprefix + l; } else { if (p =3D=3D compprefix) return 0; --nextPart3119316.5ULS3rI9YD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBDBLjDR6LMutpd94wRAulCAJsEjYO6ZCFykuK9loHEcJ/uUeA5mACgmwmw 9Oe4pmvYlqnMQbmpb8uPBr4= =YPkh -----END PGP SIGNATURE----- --nextPart3119316.5ULS3rI9YD--