zsh-users
 help / color / mirror / code / Atom feed
From: Vincent Stemen <zsh@hightek.org>
To: Wayne Davison <wayned@users.sourceforge.net>
Cc: zsh-users@sunsite.dk
Subject: Re: Possible bug in zsh
Date: Sat, 3 Jan 2004 17:09:31 -0600	[thread overview]
Message-ID: <20040103230931.GA63684@quark.localdomain> (raw)
In-Reply-To: <20040101233856.GA13263@blorf.net>

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.

<manual>

-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"

</manual>

Regards,
Vincent

-- 
Vincent Stemen
Avoid the VeriSign/Network Solutions domain registration trap!
http://www.InetAddresses.net


      parent reply	other threads:[~2004-01-03 23:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29  8:02 Vincent Stemen
2003-12-29  9:21 ` Wayne Davison
2004-01-01 23:38   ` Wayne Davison
2004-01-02  1:32     ` James Devenish
2004-01-03 23:09     ` Vincent Stemen [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=20040103230931.GA63684@quark.localdomain \
    --to=zsh@hightek.org \
    --cc=wayned@users.sourceforge.net \
    --cc=zsh-users@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).