aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--builtin.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b3a89360..e8b40d24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_print, do_printf): Use output_fp as default
+ output for print/printf only if running under the debugger.
+ Otherwise use stdout as Brian, Peter, and Al intended.
+
2012-12-25 Arnold D. Robbins <arnold@skeeve.com>
Remove sym-constant from API after discussions with John
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();