aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Howard <yzena.tech@gmail.com>2021-04-20 20:55:09 -0600
committerGavin Howard <yzena.tech@gmail.com>2021-04-20 20:55:09 -0600
commite2ac313ba8428e4f23d69360a78033748e6b24ba (patch)
treee1eaa718dc7acedb6c56c92832bef0f337657fa9
parent940f93266ce352dc54542da4a8e92e578cc73d04 (diff)
downloadbc-e2ac313ba8428e4f23d69360a78033748e6b24ba.tar.gz
Ensure output is flushed in scripts
I want to change this because I was using a print statement to track progress in a script, and it wasn't flushing. It only flushed when I sent a SIGINT. That is not good behavior, and it's behavior I have only because I had to implement my own flushing for bc. Fix this by flushing when stuff is printed.
-rw-r--r--src/program.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/program.c b/src/program.c
index 82735083..c1e61f72 100644
--- a/src/program.c
+++ b/src/program.c
@@ -2034,6 +2034,7 @@ void bc_program_exec(BcProgram *p) {
case BC_INST_PRINT_STR:
{
bc_program_print(p, inst, 0);
+ bc_file_flush(&vm.fout, bc_flush_save);
break;
}