# HG changeset patch # User Kenichi Handa # Date 913696538 0 # Node ID 18e5d1cfa74bbc7cfb2af4d5f92f4ccada62da24 # Parent 0d713a8426b64c8b832369a6366875ffd6fb231e (read_process_output): If NBYTES is zero and CODING_MODE_LAST_BLOCK bit is not yet set in coding->mode, set it and try decoding again. (Fprocess_send_eof): If the coding system of PROCESS requires flushing, call send_process with null-string at first. diff -r 0d713a8426b6 -r 18e5d1cfa74b src/process.c --- a/src/process.c Tue Dec 15 04:35:38 1998 +0000 +++ b/src/process.c Tue Dec 15 04:35:38 1998 +0000 @@ -2841,7 +2841,12 @@ /* At this point, NBYTES holds number of characters just received (including the one in proc_buffered_char[channel]). */ - if (nbytes <= 0) return nbytes; + if (nbytes <= 0) + { + if (nbytes < 0 || coding->mode & CODING_MODE_LAST_BLOCK) + return nbytes; + coding->mode |= CODING_MODE_LAST_BLOCK; + } /* Now set NBYTES how many bytes we must decode. */ nbytes += carryover; @@ -3846,8 +3851,10 @@ Lisp_Object process; { Lisp_Object proc; + struct coding_system *coding; proc = get_process (process); + coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; /* Make sure the process is really alive. */ if (! NILP (XPROCESS (proc)->raw_status_low)) @@ -3855,6 +3862,12 @@ if (! EQ (XPROCESS (proc)->status, Qrun)) error ("Process %s not running", XSTRING (XPROCESS (proc)->name)->data); + if (CODING_REQUIRE_FLUSHING (coding)) + { + coding->mode |= CODING_MODE_LAST_BLOCK; + send_process (proc, "", 0, Qnil); + } + #ifdef VMS send_process (proc, "\032", 1, Qnil); /* ^z */ #else