From deff9dacc97cc20015d3018992f2c77cb7fab102 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 12 Sep 2013 04:07:52 -0400 Subject: Enhance the output sync mode. Create a new file, output.c, and collect functions that generate output there. We introduce a new global context specifying where output should go (to stdout or to a sync file), and the lowest level output generator chooses where to write output based on that context. This allows us to set the context globally, and all operations that write output (including functions like $(info ...) etc.) will use it. Removed the "--trace=dir" capability. It was too confusing. If you have directory tracking enabled then output sync will print the enter/leave message for each synchronized block. If you don't want that, disable directory tracking. --- function.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'function.c') diff --git a/function.c b/function.c index 9eabd73..3379c90 100644 --- a/function.c +++ b/function.c @@ -1089,8 +1089,8 @@ func_error (char *o, char **argv, const char *funcname) break; case 'i': - printf ("%s\n", msg); - fflush (stdout); + outputs (0, msg); + outputs (0, "\n"); break; default: @@ -1675,6 +1675,9 @@ func_shell_base (char *o, char **argv, int trim_newlines) else error_prefix = ""; + /* Set up the output in case the shell writes something. */ + output_start (); + #if defined(__MSDOS__) fpipe = msdos_openpipe (pipedes, &pid, argv[0]); if (pipedes[0] < 0) -- cgit v1.2.3