Browse Source

Make sure output is flushed before a read

I found this bug by a script I wrote to do aviation related stuff, a
script that would prompt for input without using newlines (because it
used `-P` in its hash-bang line).
master
Gavin Howard 2 months ago
parent
commit
52670bd9b9
Signed by: gavin GPG Key ID: C08038BDF280D33E
  1. 4
      src/program.c

4
src/program.c

@ -1928,6 +1928,10 @@ void bc_program_exec(BcProgram *p) {
case BC_INST_READ:
{
// We want to flush output before
// this in case there is a prompt.
bc_file_flush(&vm.fout);
bc_program_read(p);
ip = bc_vec_top(&p->stack);

Loading…
Cancel
Save