]> code.delx.au - gnu-emacs/commitdiff
Properly handle lambda as read function (bug 22961)
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 9 Mar 2016 18:40:00 +0000 (19:40 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Wed, 9 Mar 2016 18:45:40 +0000 (19:45 +0100)
* src/lread.c (readchar): Be more strict about checking for
string in cons for read_vector.
(unreadchar): Likewise.

src/lread.c

index 25e3ff01d472b6514dea61b1c8cbc9ce88b6979a..828c76ce49d1af6f811f7de9fbe0a0334f49463b 100644 (file)
@@ -264,7 +264,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
       return c;
     }
 
-  if (CONSP (readcharfun))
+  if (CONSP (readcharfun) && STRINGP (XCAR (readcharfun)))
     {
       /* This is the case that read_vector is reading from a unibyte
         string that contains a byte sequence previously skipped
@@ -406,7 +406,7 @@ unreadchar (Lisp_Object readcharfun, int c)
       read_from_string_index_byte
        = string_char_to_byte (readcharfun, read_from_string_index);
     }
-  else if (CONSP (readcharfun))
+  else if (CONSP (readcharfun) && STRINGP (XCAR (readcharfun)))
     {
       unread_char = c;
     }