more on `port-commit-peeked' and EOFs

Continues/fixes commit 4c3dd00d49.
This commit is contained in:
Matthew Flatt 2012-07-26 10:38:01 -06:00
parent 1efc894ada
commit 87d24ece78
2 changed files with 7 additions and 4 deletions

View File

@ -42,7 +42,8 @@
(test eof peek-char p)
(test eof read-char p)
(test #f sync/timeout 0 progress-evt5)
(test #f port-commit-peeked 1 progress-evt5 always-evt p)))))))
;; it happens that a commit of EOF succeeds for tested ports:
(test #t port-commit-peeked 1 progress-evt5 always-evt p)))))))
(test-hello-port (open-input-string "hello") #f)
(test-hello-port (open-input-string "hello") #t)

View File

@ -2325,9 +2325,11 @@ intptr_t scheme_get_byte_string_unless(const char *who,
unless_evt = SCHEME_PTR2_VAL(unless_evt);
if (ip->pending_eof > 1) {
ip->pending_eof = 1;
if (ip->progress_evt)
post_progress(ip);
if (!peek) {
ip->pending_eof = 1;
if (ip->progress_evt)
post_progress(ip);
}
gc = EOF;
} else {
/* Call port's get or peek function. But first, set up