aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index 09a3287f..2db769dc 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1650,8 +1650,10 @@ do_printf(int nargs, int redirtype)
rp = redirect(redir_exp, redirtype, & errflg);
if (rp != NULL)
fp = rp->output.fp;
- } else
+ } else if (do_debug) /* only the debugger can change the default output */
fp = output_fp;
+ else
+ fp = stdout;
tmp = printf_common(nargs);
if (redir_exp != NULL) {
@@ -2076,8 +2078,10 @@ do_print(int nargs, int redirtype)
rp = redirect(redir_exp, redirtype, & errflg);
if (rp != NULL)
fp = rp->output.fp;
- } else
+ } else if (do_debug) /* only the debugger can change the default output */
fp = output_fp;
+ else
+ fp = stdout;
for (i = 1; i <= nargs; i++) {
tmp = args_array[i] = POP();