From e3d03ee3dec31fd28d668ae14bed936af199d9b0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 27 Dec 2012 20:32:55 +0200 Subject: Use output_fp for print/printf only if debugging. --- builtin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'builtin.c') 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(); -- cgit v1.2.3