Fix fencepost error in bip_seek
* libguile/r6rs-ports.c (bip_seek): Fix to allow seeking to end of port.
* test-suite/tests/r6rs-ports.test ("bytevector input port can seek to
very end"): Add tests.
This commit is contained in:
parent
15993bce1c
commit
c89b452993
2 changed files with 10 additions and 1 deletions
|
|
@ -136,7 +136,7 @@ bip_seek (SCM port, scm_t_off offset, int whence)
|
|||
/* Fall through. */
|
||||
|
||||
case SEEK_SET:
|
||||
if (c_port->read_buf + offset < c_port->read_end)
|
||||
if (c_port->read_buf + offset <= c_port->read_end)
|
||||
{
|
||||
c_port->read_pos = c_port->read_buf + offset;
|
||||
c_result = offset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue