(unreadchar): Don't back up the pointer when unreading EOF.
authorKarl Heuer <kwzh@gnu.org>
Tue, 22 Mar 1994 22:20:38 +0000 (22:20 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 22 Mar 1994 22:20:38 +0000 (22:20 +0000)
src/lread.c

index af7a015..760cb46 100644 (file)
@@ -165,7 +165,11 @@ unreadchar (readcharfun, c)
      Lisp_Object readcharfun;
      int c;
 {
-  if (XTYPE (readcharfun) == Lisp_Buffer)
+  if (c == -1)
+    /* Don't back up the pointer if we're unreading the end-of-input mark,
+       since readchar didn't advance it when we read it.  */
+    ;
+  else if (XTYPE (readcharfun) == Lisp_Buffer)
     {
       if (XBUFFER (readcharfun) == current_buffer)
        SET_PT (point - 1);