Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Possible bug in zsh



On Mon, Dec 29, 2003 at 02:02:22AM -0600, Vincent Stemen wrote:
> I think I may have encountered a bug in Z shell.

Here's a simplified test case that better shows what's gone wrong:

false; if eval ''; then echo one; fi
true; if eval ''; then echo two; fi

This outputs only "two" in zsh, but both "one" and "two" in bash.  It
appears that an eval of an empty string in zsh returns the return code
of the last-run command.  In your example script, the "[ -n ...]" part
failed, so the following "if ! eval $empty ..." bit was executed as if
the eval of the empty string had also failed.  I also assume that this
is a bug.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author