1
Fork 0
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:
Andy Wingo 2016-05-01 22:00:37 +02:00
parent 4ba59e94f9
commit 422f65fe09

View file

@ -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))))))))