projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad3f8af
)
Fix bug: would-block value only returned if nothing has been read.
author
Chris Hanson
<org/chris-hanson/cph>
Sun, 29 Jan 2017 06:00:21 +0000
(22:00 -0800)
committer
Chris Hanson
<org/chris-hanson/cph>
Sun, 29 Jan 2017 06:00:21 +0000
(22:00 -0800)
src/runtime/genio.scm
patch
|
blob
|
history
diff --git
a/src/runtime/genio.scm
b/src/runtime/genio.scm
index 8669b9b59ac0bc00d169b38ed3ac7c96303a7657..4f9e78fbc25358c2852ee9e5c4fd20340c8a7900 100644
(file)
--- a/
src/runtime/genio.scm
+++ b/
src/runtime/genio.scm
@@
-236,8
+236,12
@@
USA.
(let loop ((index start))
(if (fix:< index end)
(let ((char (generic-io/read-char port)))
- (cond ((not char) #f)
- ((eof-object? char) (fix:- index start))
+ (cond ((not char)
+ (if (fix:< start index)
+ (fix:- index start)
+ #f))
+ ((eof-object? char)
+ (fix:- index start))
(else
(ustring-set! string index char)
(loop (fix:+ index 1)))))