zsh-workers
 help / color / mirror / code / Atom feed
* XTRACE output -- I thought we'd fixed this?
@ 2011-05-16 21:28 Bart Schaefer
  2011-05-23  9:14 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2011-05-16 21:28 UTC (permalink / raw)
  To: zsh-workers

bash-3.2$ set -x
bash-3.2$ echo hello 2>/dev/null
+ echo hello
hello
bash-3.2$ 

torch% set -x
torch% echo hello 2>/dev/null
hello
torch% echo hello
+Src/zsh:3> echo hello
hello
torch% 

Stderr redirection isn't supposed to redirect the xtrace descriptor unless
you use a { ... } construct.  There's even this in exec.c:execcmd():

    /* Make a copy of stderr for xtrace output before redirecting */
    fflush(xtrerr);
    if (isset(XTRACE) && xtrerr == stderr &&
	(type < WC_SUBSH || type == WC_TIMED)) {
	if ((newxtrerr = fdopen(movefd(dup(fileno(stderr))), "w"))) {
	    xtrerr = newxtrerr;
	    fdtable[fileno(xtrerr)] = FDT_XTRACE;
	}
    }

Yet E02xtrace.ztst appears to expect this (wrong?) behavior, so I must be
mis-remembering something.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-24  6:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 21:28 XTRACE output -- I thought we'd fixed this? Bart Schaefer
2011-05-23  9:14 ` Peter Stephenson
2011-05-23 15:19   ` Bart Schaefer
2011-05-24  6:16     ` PATCH (1 of 2): " Bart Schaefer
2011-05-24  6:35       ` PATCH (2 " Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).