summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-07-13 10:42:42 +0200
committerAndy Wingo <wingo@pobox.com>2010-07-13 10:42:52 +0200
commit2f26a2266a3354606167a7f01df031bca8d727e9 (patch)
treea3483cbcd2e64539c3a8f3fb400d4536b23224c4 /module
parentdbb39d9c8ba006d419eb87cf3a92bd2b078808f9 (diff)
downloadguile-2f26a2266a3354606167a7f01df031bca8d727e9.tar.gz
ctrl-d with readline exits one recursive repl instance
* module/ice-9/buffered-input.scm (make-buffered-input-port): Instead of always returning EOF once EOF is seen once, call the producer again. Allows Ctrl-D to cause one EOF at the REPL, returning once from a recursive edit, but input continues normally. Thanks to Andrew Bagdanov for a clue that led to the fix.
Diffstat (limited to 'module')
-rw-r--r--module/ice-9/buffered-input.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/module/ice-9/buffered-input.scm b/module/ice-9/buffered-input.scm
index 05e9255c0..c35fdb87e 100644
--- a/module/ice-9/buffered-input.scm
+++ b/module/ice-9/buffered-input.scm
@@ -64,7 +64,10 @@ with @var{continuation?} set to @code{#t}."
(lambda ()
(cond
((eof-object? read-string)
- read-string)
+ (let ((eof read-string))
+ (set! read-string "")
+ (set! string-index -1)
+ eof))
((>= string-index (string-length read-string))
(set! string-index -1)
(get-character))