From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4666 invoked from network); 3 Jan 2004 23:09:47 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Jan 2004 23:09:47 -0000 Received: (qmail 12358 invoked by alias); 3 Jan 2004 23:09:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6972 Received: (qmail 12317 invoked from network); 3 Jan 2004 23:09:25 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Jan 2004 23:09:25 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [68.1.17.115] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Jan 2004 23:9:24 -0000 Received: from quark.localdomain ([68.12.75.33]) by lakemtao06.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040103230924.WEAF24575.lakemtao06.cox.net@quark.localdomain>; Sat, 3 Jan 2004 18:09:24 -0500 Received: from quark.localdomain (localhost.localdomain [127.0.0.1]) by quark.localdomain (8.12.9/8.12.9) with ESMTP id i03N9WuO063792; Sat, 3 Jan 2004 17:09:32 -0600 (CST) (envelope-from vince@quark.localdomain) Received: (from vince@localhost) by quark.localdomain (8.12.9/8.12.9/Submit) id i03N9Vig063791; Sat, 3 Jan 2004 17:09:31 -0600 (CST) Date: Sat, 3 Jan 2004 17:09:31 -0600 From: Vincent Stemen To: Wayne Davison Cc: zsh-users@sunsite.dk Subject: Re: Possible bug in zsh Message-ID: <20040103230931.GA63684@quark.localdomain> References: <20031229080222.GA75453@quark.localdomain> <20031229092122.GA23732@binome.blorf.net> <20040101233856.GA13263@blorf.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040101233856.GA13263@blorf.net> User-Agent: Mutt/1.4.1i On Thu, Jan 01, 2004 at 03:38:56PM -0800, Wayne Davison wrote: > On Mon, Dec 29, 2003 at 01:21:22AM -0800, Wayne Davison wrote: > > false; if eval ''; then echo one; fi [...fails...] > > true; if eval ''; then echo two; fi [...succeeds...] > > I'm hoping that someone more familiar with the exec internals will jump > in here, but in the meantime, here's the change I made back on Monday to > fix this bug: > > --- Src/builtin.c 13 Nov 2003 14:34:38 -0000 1.109 > +++ Src/builtin.c 29 Dec 2003 09:50:52 -0000 > @@ -4155,6 +4155,7 @@ > errflag = 0; > return 1; > } > + lastval = 0; > execode(prog, 1, 0); > if (errflag) { > lastval = errflag; > > I'm not sure it's the best fix, though, as it might be better to change > one of the lower functions down in the execode() calling chain instead > of changing bin_eval(). It does fix the bug, though. > > ..wayne.. Thanks for the responses Wayne. I will archive this in case I need it in the future. For now, it looks like there are also other incompatibilities in running the init scripts (well, at least one so far) that also prevent using zsh as sh in FreeBSD. So, I think I will put that idea on hold for now and stick with the native /bin/sh. I temporarily modified the init script code which got around the eval problem and discovered that some of the scripts use "set -T" which is not implemented in zsh. The FreeBSD sh man page says this about it. -T trapsasync When waiting for a child, execute traps immediately. If this option is not set, traps are executed after the child exits, as specified in IEEE Std 1003.2 (``POSIX.2'') This nonstandard option is useful for putting guarding shells around children that block signals. The surrounding shell may kill the child or it may just return control to the tty and leave the child alone, like this: sh -T -c "trap 'exit 1' 2 ; some-blocking-program" Regards, Vincent -- Vincent Stemen Avoid the VeriSign/Network Solutions domain registration trap! http://www.InetAddresses.net