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

Re: Possible bug in zsh



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



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