From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20349 invoked from network); 1 Jul 2009 09:09:22 -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.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 1 Jul 2009 09:09:22 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 7321 invoked from network); 1 Jul 2009 09:00:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Jul 2009 09:00:30 -0000 Received: (qmail 20318 invoked by alias); 1 Jul 2009 09:00:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27079 Received: (qmail 20297 invoked from network); 1 Jul 2009 09:00:11 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 1 Jul 2009 09:00:11 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 558A280307FA for ; Wed, 1 Jul 2009 11:00:07 +0200 (CEST) Received: from rly39d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly39d.srv.mailcontrol.com (MailControl) with ESMTP id n61901Xb006969 for ; Wed, 1 Jul 2009 10:00:05 +0100 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by rly39d.srv.mailcontrol.com (MailControl) id n618xnMq005809 for ; Wed, 1 Jul 2009 09:59:49 +0100 Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly39d-eth0.srv.mailcontrol.com (envelope-sender ) (MIMEDefang) with ESMTP id n618xYd6004152; Wed, 01 Jul 2009 09:59:49 +0100 (BST) Received: from news01 ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Jul 2009 09:59:46 +0100 Date: Wed, 1 Jul 2009 09:59:46 +0100 From: Peter Stephenson To: Takahiro SUZUKI , zsh-workers@sunsite.dk Subject: Re: Bug in built-in 'test' under cont $CONTEXT Message-ID: <20090701095946.5b5bc41a@news01> In-Reply-To: <4A4A8C51.3080106@gmail.com> References: <4A4A8C51.3080106@gmail.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Jul 2009 08:59:46.0641 (UTC) FILETIME=[485D3C10:01C9FA2A] X-Scanned-By: MailControl A-09-00-10 (www.mailcontrol.com) on 10.68.1.149 X-Virus-Scanned: ClamAV 0.94.2/9531/Wed Jul 1 07:09:17 2009 on bifrost X-Virus-Status: Clean On Wed, 01 Jul 2009 07:06:09 +0900 Takahiro SUZUKI 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 Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070