aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorKenichi Handa1998-12-15 04:35:38 +0000
committerKenichi Handa1998-12-15 04:35:38 +0000
commitde7fbd0989386dc9de4feff5f0d87d078c5ae581 (patch)
tree325f7076437d94762d89f8083ec050e15999557c /src/process.c
parentc91beee236d43231da8dbe1edb519d61a9c828ee (diff)
downloademacs-de7fbd0989386dc9de4feff5f0d87d078c5ae581.tar.gz
emacs-de7fbd0989386dc9de4feff5f0d87d078c5ae581.zip
(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.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index a65eb2413d7..941e0a266d9 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2841,7 +2841,12 @@ read_process_output (proc, channel)
2841 2841
2842 /* At this point, NBYTES holds number of characters just received 2842 /* At this point, NBYTES holds number of characters just received
2843 (including the one in proc_buffered_char[channel]). */ 2843 (including the one in proc_buffered_char[channel]). */
2844 if (nbytes <= 0) return nbytes; 2844 if (nbytes <= 0)
2845 {
2846 if (nbytes < 0 || coding->mode & CODING_MODE_LAST_BLOCK)
2847 return nbytes;
2848 coding->mode |= CODING_MODE_LAST_BLOCK;
2849 }
2845 2850
2846 /* Now set NBYTES how many bytes we must decode. */ 2851 /* Now set NBYTES how many bytes we must decode. */
2847 nbytes += carryover; 2852 nbytes += carryover;
@@ -3846,8 +3851,10 @@ text to PROCESS after you call this function.")
3846 Lisp_Object process; 3851 Lisp_Object process;
3847{ 3852{
3848 Lisp_Object proc; 3853 Lisp_Object proc;
3854 struct coding_system *coding;
3849 3855
3850 proc = get_process (process); 3856 proc = get_process (process);
3857 coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)];
3851 3858
3852 /* Make sure the process is really alive. */ 3859 /* Make sure the process is really alive. */
3853 if (! NILP (XPROCESS (proc)->raw_status_low)) 3860 if (! NILP (XPROCESS (proc)->raw_status_low))
@@ -3855,6 +3862,12 @@ text to PROCESS after you call this function.")
3855 if (! EQ (XPROCESS (proc)->status, Qrun)) 3862 if (! EQ (XPROCESS (proc)->status, Qrun))
3856 error ("Process %s not running", XSTRING (XPROCESS (proc)->name)->data); 3863 error ("Process %s not running", XSTRING (XPROCESS (proc)->name)->data);
3857 3864
3865 if (CODING_REQUIRE_FLUSHING (coding))
3866 {
3867 coding->mode |= CODING_MODE_LAST_BLOCK;
3868 send_process (proc, "", 0, Qnil);
3869 }
3870
3858#ifdef VMS 3871#ifdef VMS
3859 send_process (proc, "\032", 1, Qnil); /* ^z */ 3872 send_process (proc, "\032", 1, Qnil); /* ^z */
3860#else 3873#else