From a039c6a600ec6e1ad03fb0c5b1ada336ddf8fdb7 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 26 Mar 2012 19:06:22 -0700 Subject: * match.c (v_output): Bugfix: we should flush the stream after each @(output) block. Otherwise if output blocks that go to standard output are interleaved with output blocks which pipe to some command which then goes to standard out, the output won't be in the proper order. --- ChangeLog | 8 ++++++++ match.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3c3010ec..d6b2e1e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-03-26 Kaz Kylheku + + * match.c (v_output): Bugfix: we should flush the stream + after each @(output) block. Otherwise if output blocks + that go to standard output are interleaved with output blocks + which pipe to some command which then goes to standard out, + the output won't be in the proper order. + 2012-03-26 Kaz Kylheku * eval.c (eval_init): New intrinsic num-str registered. diff --git a/match.c b/match.c index 01b4562a..b70a796e 100644 --- a/match.c +++ b/match.c @@ -3009,6 +3009,7 @@ static val v_output(match_files_ctx *c) uw_env_begin; uw_set_match_context(cons(c->spec, c->bindings)); do_output(c->bindings, specs, filter, stream); + flush_stream(stream); uw_env_end; { @@ -3049,6 +3050,7 @@ static val v_output(match_files_ctx *c) uw_env_begin; uw_set_match_context(cons(c->spec, c->bindings)); do_output(c->bindings, specs, filter, stream); + flush_stream(stream); uw_env_end; close_stream(stream, t); } -- cgit v1.2.3