about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e97d7a2cc..58e9c9a51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-04  Bart Schaefer  <schaefer@zsh.org>
+
+	* 20318: Src/builtin.c: fix subtle xtrace output bug introduced
+	by 20308.
+
 2004-09-03  Peter Stephenson  <pws@csr.com>
 
 	* 20308: Doc/Zsh/options.yo, Src/builtin.c, Src/exec.c,
diff --git a/Src/builtin.c b/Src/builtin.c
index 44d85b80a..a9d9b413e 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4235,16 +4235,18 @@ bin_eval(UNUSED(char *nam), char **argv, UNUSED(Options ops), UNUSED(int func))
      * we use a special script name to indicate the special line number.
      */
     ineval = !isset(EVALLINENO);
+    if (!ineval)
+	scriptname = "(eval)";
 
     prog = parse_string(zjoin(argv, ' ', 1));
     if (!prog) {
 	errflag = 0;
+        scriptname = oscriptname;
+        ineval = oineval;
 	return 1;
     }
 
     lastval = 0;
-    if (!ineval)
-	scriptname = "(eval)";
 
     execode(prog, 1, 0);
 
@@ -4253,8 +4255,7 @@ bin_eval(UNUSED(char *nam), char **argv, UNUSED(Options ops), UNUSED(int func))
 	errflag = 0;
     }
 
-    if (!ineval)
-	scriptname = oscriptname;
+    scriptname = oscriptname;
     ineval = oineval;
 
     return lastval;