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:
Ian Price 2011-04-08 02:49:20 +01:00 committed by Andy Wingo
commit c89b452993
2 changed files with 10 additions and 1 deletions

View file

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