Commit de7fbd09 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(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.
parent c91beee2
......@@ -2841,7 +2841,12 @@ read_process_output (proc, channel)
/* 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 @@ text to PROCESS after you call this function.")
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 @@ text to PROCESS after you call this function.")
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment