about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-02-19 12:26:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-02-19 12:26:08 +0000
commitbbc88550db62ffe2cbdecd62c21252a941f8db36 (patch)
treef8bb38981a4f18dd377ad8fc585900187d2ef50a
parent1c7075f8b921638d4a0d32358e63ae1648ac1b45 (diff)
downloadzsh-bbc88550db62ffe2cbdecd62c21252a941f8db36.tar.gz
zsh-bbc88550db62ffe2cbdecd62c21252a941f8db36.tar.xz
zsh-bbc88550db62ffe2cbdecd62c21252a941f8db36.zip
27723: eval shouldn't modify non-zero return statuses
-rw-r--r--ChangeLog7
-rw-r--r--Src/builtin.c2
-rw-r--r--Test/D02glob.ztst2
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 56a1a79ee..41a4ecc2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-19  Peter Stephenson  <pws@csr.com>
+
+	* 27723: Src/builtin.c, Test/D02glob.ztst: eval shouldn't
+	modify non-zero return statuses.
+
 2010-02-17  Peter Stephenson  <pws@csr.com>
 
 	* Frank: 27717: Functions/VCS_Info/vcs_info_lastmsg:
@@ -12774,5 +12779,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4905 $
+* $Revision: 1.4906 $
 *****************************************************
diff --git a/Src/builtin.c b/Src/builtin.c
index 2a02c9a96..d293a7a78 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4885,7 +4885,7 @@ eval(char **argv)
 	} else {
 	    execode(prog, 1, 0);
 
-	    if (errflag)
+	    if (errflag && !lastval)
 		lastval = errflag;
 	}
     } else {
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 84453ee5c..0aea26183 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -425,7 +425,7 @@
 >/ [[:WORD:]] yes
 
  [[ foo = (#c0)foo ]]
-1:Misplaced (#c...) flag
+2:Misplaced (#c...) flag
 ?(eval):1: bad pattern: (#c0)foo
 
  mkdir glob.tmp/dir5