register Lisp_Object val;
int count = specpdl_ptr - specpdl;
struct gcpro gcpro1;
+ struct buffer *b = 0;
+
+ if (BUFFERP (readcharfun))
+ b = XBUFFER (readcharfun);
+ else if (MARKERP (readcharfun))
+ b = XMARKER (readcharfun)->buffer;
specbind (Qstandard_input, readcharfun);
specbind (Qcurrent_load_list, Qnil);
while (1)
{
+ if (b != 0 && NILP (b->name))
+ error ("Reading from killed buffer");
+
instream = stream;
c = READCHAR;
if (c == ';')