zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Takahiro SUZUKI <takahiro.suzuki.ja@gmail.com>, zsh-workers@sunsite.dk
Subject: Re: Bug in built-in 'test' under cont $CONTEXT
Date: Wed, 1 Jul 2009 09:59:46 +0100	[thread overview]
Message-ID: <20090701095946.5b5bc41a@news01> (raw)
In-Reply-To: <4A4A8C51.3080106@gmail.com>

On Wed, 01 Jul 2009 07:06:09 +0900
Takahiro SUZUKI <takahiro.suzuki.ja@gmail.com> wrote:
> I found a bug in builtin test command under $CONTEXT=="cont".
> 
> Using builtin test command via zle widget when zsh is pending for "for",
> the shell fails with segmentation fault. This does not occur when using
> /usr/bin/test instead, so I guess it is a problem of zsh.

Thanks, this made it very quick to work out what was going on.

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.227
diff -u -r1.227 builtin.c
--- Src/builtin.c	20 May 2009 09:53:22 -0000	1.227
+++ Src/builtin.c	1 Jul 2009 08:57:30 -0000
@@ -5812,12 +5812,14 @@
 	}
     }
 
+    lexsave();
     testargs = argv;
     tok = NULLTOK;
     condlex = testlex;
     testlex();
     prog = parse_cond();
     condlex = zshlex;
+    lexrestore();
 
     if (errflag) {
 	errflag = 0;


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


      parent reply	other threads:[~2009-07-01  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 22:06 Takahiro SUZUKI
2009-06-30 23:31 ` Mikael Magnusson
2009-07-01  8:59 ` Peter Stephenson [this message]

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=20090701095946.5b5bc41a@news01 \
    --to=pws@csr.com \
    --cc=takahiro.suzuki.ja@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).