From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2180 invoked from network); 16 Aug 2005 19:28:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Aug 2005 19:28:28 -0000 Received: (qmail 26454 invoked from network); 16 Aug 2005 19:28:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Aug 2005 19:28:22 -0000 Received: (qmail 28097 invoked by alias); 16 Aug 2005 19:28:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21643 Received: (qmail 28087 invoked from network); 16 Aug 2005 19:28:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 16 Aug 2005 19:28:19 -0000 Received: (qmail 26129 invoked from network); 16 Aug 2005 19:28:19 -0000 Received: from flock1.newmail.ru (212.48.140.157) by a.mx.sunsite.dk with SMTP; 16 Aug 2005 19:28:11 -0000 Received: (qmail 29749 invoked from network); 16 Aug 2005 19:20:42 -0000 Received: from unknown (HELO ?10.0.0.53?) (arvidjaar@newmail.ru@83.237.106.159) by smtpd.newmail.ru with SMTP; 16 Aug 2005 19:20:42 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: crash in completing code with unicode support Date: Tue, 16 Aug 2005 23:27:49 +0400 User-Agent: KMail/1.8.2 Cc: Mikael Magnusson References: <237967ef05081518376385563e@mail.gmail.com> <200508161157.59407.arvidjaar@newmail.ru> <237967ef050816050130fefbf8@mail.gmail.com> In-Reply-To: <237967ef050816050130fefbf8@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1414853.uPjXktbUZF"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200508162327.58597.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 --nextPart1414853.uPjXktbUZF Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 16 August 2005 16:01, Mikael Magnusson wrote: > > mkdir /tmp/foo > cd /tmp/foo > a=3D`echo +ANg- | iconv -f utf-7 -t utf-8` > touch ${a}a ${a}b > zsh -f > autoload -U compinit; compinit > ls > > That is all i have to do to get the crash. (I didn't compile with > --enable-zsh-debug, because then i only get an error message like > "BUG: substring ends in the middle of a metachar in ztrsub()", instead > i specified the flags manually) I still cannot make it crash but I get BUG in ztrsub too. The bug was always there it is just that it is much more difficult to creat= e=20 such case in single byte encoding. Does the following patch helps? (somewha= t=20 unexpectedly all regression tests still pass here) Index: 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.28 diff -u -p -r1.28 complete.c =2D-- complete.c 21 Mar 2005 18:49:41 -0000 1.28 +++ complete.c 16 Aug 2005 19:24:00 -0000 @@ -821,8 +821,9 @@ do_comp_vars(int test, int na, char *sa, add =3D -1; } else { p =3D compprefix + 1; + /* FIXME check EOS */ if (*p =3D=3D Meta) =2D p++; + p +=3D 2; add =3D 1; } for (;;) { @@ -835,6 +836,7 @@ do_comp_vars(int test, int na, char *sa, if (add > 0) { if (p =3D=3D compprefix + l) return 0; + /* FIXME check EOS */ if (*p =3D=3D Meta) p +=3D 2; else --nextPart1414853.uPjXktbUZF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBDAj4+R6LMutpd94wRAvtTAKCfrcwursVSpgVhLsvz9qFNPWQDnACbB6+i U0YpfCcGGq8ySZS7GMAVic8= =wKkw -----END PGP SIGNATURE----- --nextPart1414853.uPjXktbUZF--