aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-12-27 20:32:55 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-12-27 20:32:55 +0200
commite3d03ee3dec31fd28d668ae14bed936af199d9b0 (patch)
tree801ac9a67e135914acbee1fe9e25b5416451c7ad
parent566df675d8a6bb0c632231abe2e7573ce9f9541d (diff)
downloadegawk-e3d03ee3dec31fd28d668ae14bed936af199d9b0.tar.gz
egawk-e3d03ee3dec31fd28d668ae14bed936af199d9b0.tar.bz2
egawk-e3d03ee3dec31fd28d668ae14bed936af199d9b0.zip
Use output_fp for print/printf only if debugging.
-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();