From 7ce63188c972f4bd803bbb75c3e85f909a292ea0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Jun 1997 06:24:22 +0000 Subject: [PATCH] (wait_reading_process_input): When exiting because the process WAIT_PROC has terminated, first read all its output. --- src/process.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/process.c b/src/process.c index a9da5b1f725..bebfba77843 100644 --- a/src/process.c +++ b/src/process.c @@ -2305,7 +2305,17 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) if (wait_proc != 0 && ! EQ (wait_proc->status, Qrun)) { + int nread, total_nread; + clear_waiting_for_input (); + XSETPROCESS (proc, wait_proc); + + /* Read data from the process, until we exhaust it. */ + while (nread = read_process_output (proc, XINT (wait_proc->infd))) + total_nread += nread; + if (total_nread > 0 && do_display) + redisplay_preserve_echo_area (); + break; } -- 2.39.5