zsh-workers
 help / color / mirror / code / Atom feed
From: Andrey Borzenkov <arvidjaar@newmail.ru>
To: zsh-workers@sunsite.dk
Cc: Mikael Magnusson <mikachu@gmail.com>
Subject: Re: crash in completing code with unicode support
Date: Tue, 16 Aug 2005 23:27:49 +0400	[thread overview]
Message-ID: <200508162327.58597.arvidjaar@newmail.ru> (raw)
In-Reply-To: <237967ef050816050130fefbf8@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

On Tuesday 16 August 2005 16:01, Mikael Magnusson wrote:
>
> mkdir /tmp/foo
> cd /tmp/foo
> a=`echo +ANg- | iconv -f utf-7 -t utf-8`
> touch ${a}a ${a}b
> zsh -f
> autoload -U compinit; compinit
> ls <tab><tab>
>
> 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 create 
such case in single byte encoding. Does the following patch helps? (somewhat 
unexpectedly all regression tests still pass here)

Index: complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.28
diff -u -p -r1.28 complete.c
--- 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 = -1;
                } else {
                    p = compprefix + 1;
+                   /* FIXME check EOS */
                    if (*p == Meta)
-                       p++;
+                       p += 2;
                    add = 1;
                }
                for (;;) {
@@ -835,6 +836,7 @@ do_comp_vars(int test, int na, char *sa,
                    if (add > 0) {
                        if (p == compprefix + l)
                            return 0;
+                       /* FIXME check EOS */
                        if (*p == Meta)
                            p += 2;
                        else

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-08-16 19:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-16  1:37 Mikael Magnusson
2005-08-16  7:57 ` Andrey Borzenkov
2005-08-16 11:44   ` Clint Adams
2005-08-16 12:09     ` Nikolai Weibull
2005-08-16 16:16       ` Andrey Borzenkov
2005-08-18  9:34         ` Peter Stephenson
2005-08-16 12:01   ` Mikael Magnusson
2005-08-16 19:27     ` Andrey Borzenkov [this message]
2005-08-16 21:37       ` Wayne Davison
2005-08-16 21:49         ` Wayne Davison
2005-08-17  0:22           ` crash fixed, other minor issue though was: " Mikael Magnusson
2005-08-18 16:48             ` Andrey Borzenkov
2005-08-18 16:35           ` Andrey Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200508162327.58597.arvidjaar@newmail.ru \
    --to=arvidjaar@newmail.ru \
    --cc=mikachu@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).