2009-05-02 Andreas Schwab <schwab@linux-m68k.org>
+ * process.c (read_process_output): Make sure the current buffer is
+ always restored.
+
* coding.c (record_conversion_result): Don't modify
Vlast_code_conversion_error for successful result.
(alloc_destination): Don't clobber conversion result. (Bug#1650)
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];
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;
current_buffer->read_only = old_read_only;
SET_PT_BOTH (opoint, opoint_byte);
- set_buffer_internal (old);
+ unbind_to (count, Qnil);
}
return nbytes;
}