Consume a peeked EOF at the REPL.
authorMark H Weaver <mhw@netris.org>
Mon, 8 Apr 2013 12:44:02 +0000 (08:44 -0400)
committerMark H Weaver <mhw@netris.org>
Mon, 8 Apr 2013 12:44:02 +0000 (08:44 -0400)
* module/system/repl/repl.scm (meta-reader): Consume peeked EOF.

module/system/repl/repl.scm

index 7d2b7c8..1649556 100644 (file)
       (lambda ()
         (let ((ch (flush-leading-whitespace)))
           (cond ((eof-object? ch)
-                 ;; EOF objects are not buffered. It's quite possible
-                 ;; to peek an EOF then read something else. It's
-                 ;; strange but it's how it works.
-                 ch)
+                 (read-char))  ; consume the EOF and return it
                 ((eqv? ch #\,)
-                 (read-char port)
+                 (read-char)
                  meta-command-token)
                 ((read-comment lang port ch)
                  *unspecified*)