summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2009-05-02 11:54:43 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2009-05-02 11:54:43 +0000
commit59c4c60fb1b371be5566e44b3fa6cb377001f958 (patch)
treea72afa9535467b70948ff81da5e4629a02d00229 /src/process.c
parent409ea3a1dd530feabeb8f7f21dfd9c4aa2eb7a43 (diff)
downloademacs-59c4c60fb1b371be5566e44b3fa6cb377001f958.tar.gz
emacs-59c4c60fb1b371be5566e44b3fa6cb377001f958.tar.bz2
emacs-59c4c60fb1b371be5566e44b3fa6cb377001f958.zip
(read_process_output): Make sure the current buffer is
always restored.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index 635f44466df..5fb3662532d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5185,7 +5185,6 @@ read_process_output (proc, channel)
register int nbytes;
char *chars;
register Lisp_Object outstream;
- register struct buffer *old = current_buffer;
register struct Lisp_Process *p = XPROCESS (proc);
register int opoint;
struct coding_system *coding = proc_decode_coding_system[channel];
@@ -5385,9 +5384,11 @@ read_process_output (proc, channel)
int opoint_byte;
Lisp_Object text;
struct buffer *b;
+ int count = SPECPDL_INDEX ();
odeactivate = Vdeactivate_mark;
+ record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
Fset_buffer (p->buffer);
opoint = PT;
opoint_byte = PT_BYTE;
@@ -5490,7 +5491,7 @@ read_process_output (proc, channel)
current_buffer->read_only = old_read_only;
SET_PT_BOTH (opoint, opoint_byte);
- set_buffer_internal (old);
+ unbind_to (count, Qnil);
}
return nbytes;
}