1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-22 12:30:32 +02:00

in meta-reader, return directly if the peeked char is EOF

* module/system/repl/repl.scm (meta-reader): If the (next-char #t)
  returns EOF, return that EOF directly, as it seems that with guile -q,
  the subsequent `read' actually waits for another C-d. Dunno why.
This commit is contained in:
Andy Wingo 2009-02-24 23:16:58 +01:00
parent a56db0f67e
commit abf780e45e

View file

@ -38,9 +38,15 @@
(with-input-from-port
(if (pair? read-args) (car read-args) (current-input-port))
(lambda ()
(if (eqv? (next-char #t) #\,)
(begin (read-char) meta-command-token)
(read))))))
(let ((ch (next-char #t)))
(cond ((eof-object? ch)
;; apparently sometimes even if this is eof, read will
;; wait on somethingorother. strange.
ch)
((eqv? (char #\,))
(read-char)
meta-command-token)
(else (read))))))))
;; repl-reader is a function defined in boot-9.scm, and is replaced by
;; something else if readline has been activated. much of this hoopla is