aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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