mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Minor tweak to Scheme peek-byte.
* module/ice-9/ports.scm (peek-byte): Use second return from fill-input.
This commit is contained in:
parent
4ba59e94f9
commit
422f65fe09
1 changed files with 6 additions and 5 deletions
|
@ -241,11 +241,12 @@
|
|||
(cur (port-buffer-cur buf)))
|
||||
(if (< cur (port-buffer-end buf))
|
||||
(bytevector-u8-ref (port-buffer-bytevector buf) cur)
|
||||
(let* ((buf (fill-input port))
|
||||
(cur (port-buffer-cur buf)))
|
||||
(if (< cur (port-buffer-end buf))
|
||||
(bytevector-u8-ref (port-buffer-bytevector buf) cur)
|
||||
the-eof-object)))))
|
||||
(call-with-values (lambda () (fill-input port))
|
||||
(lambda (buf buffered)
|
||||
(if (zero? buffered)
|
||||
the-eof-object
|
||||
(bytevector-u8-ref (port-buffer-bytevector buf)
|
||||
(port-buffer-cur buf))))))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue