about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2011-05-24 15:49:03 +0000
committerBart Schaefer <barts@users.sourceforge.net>2011-05-24 15:49:03 +0000
commite39dfaeb9575a602c34285390df3662c2073cc81 (patch)
tree67d01391e974606c44de42485f8e714ed6ca70d1
parent52ab943585f2b92fddfd8ed2f2b5ac5ab61df0a2 (diff)
downloadzsh-e39dfaeb9575a602c34285390df3662c2073cc81.tar.gz
zsh-e39dfaeb9575a602c34285390df3662c2073cc81.tar.xz
zsh-e39dfaeb9575a602c34285390df3662c2073cc81.zip
29367, 29368: avoid redirecting the xtrace of simple commands along with
their standard error.
-rw-r--r--ChangeLog13
-rw-r--r--Src/exec.c2
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ef64879e..8022bc2b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-05-24  Barton E. Schaefer  <schaefer@brasslantern.com>
+
+	* 29368: Src/exec.c: do not restore xtrerr to stderr before
+	running simple commands; restore xtrerr to stderr just before
+	running a function body, but after printing the trace of
+	the function call itself.
+
+	* 29367: Test/E02xtrace.ztst: update tests to fix mistaken
+	assumptions introduced by 25154 and add check of redirection
+	inside a function body.
+
 2011-05-24  Mikael Magnusson <mikachu@gmail.com>
 
 	* 29364: Completion/Unix/Command/_make: Partial fix for
@@ -14803,5 +14814,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5325 $
+* $Revision: 1.5326 $
 *****************************************************
diff --git a/Src/exec.c b/Src/exec.c
index 0e1a6c81f..2558185c8 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3079,7 +3079,6 @@ execcmd(Estate state, int input, int output, int how, int last1)
 	if (mfds[i] && mfds[i]->ct >= 2)
 	    closemn(mfds, i);
 
-    xtrerr = stderr;
     if (nullexec) {
 	if (nullexec == 1) {
 	    /*
@@ -4260,6 +4259,7 @@ execshfunc(Shfunc shf, LinkList args)
     cmdsp = 0;
     if ((osfc = sfcontext) == SFC_NONE)
 	sfcontext = SFC_DIRECT;
+    xtrerr = stderr;
     doshfunc(shf, args, 0);
     sfcontext = osfc;
     free(cmdstack);