mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-06 14:02:07 -08:00
(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.
This commit is contained in:
parent
c91beee236
commit
de7fbd0989
1 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue