[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-179-gc89b4
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-179-gc89b452 |
Date: |
Mon, 11 Apr 2011 16:15:55 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=c89b45299329d034875429804f18768c1ea96713
The branch, stable-2.0 has been updated
via c89b45299329d034875429804f18768c1ea96713 (commit)
from 15993bce1cd0a2e69f11a6ac1725fa7a219c5b7c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c89b45299329d034875429804f18768c1ea96713
Author: Ian Price <address@hidden>
Date: Fri Apr 8 02:49:20 2011 +0100
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.
-----------------------------------------------------------------------
Summary of changes:
libguile/r6rs-ports.c | 2 +-
test-suite/tests/r6rs-ports.test | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index 1f72415..7473db9 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -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;
diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test
index 70b5853..01d8235 100644
--- a/test-suite/tests/r6rs-ports.test
+++ b/test-suite/tests/r6rs-ports.test
@@ -320,6 +320,15 @@
(u8-list->bytevector
(map char->integer (string->list "Port!")))))))
+ (pass-if "bytevector input port can seek to very end"
+ (let ((empty (open-bytevector-input-port '#vu8()))
+ (not-empty (open-bytevector-input-port '#vu8(1 2 3))))
+ (and (begin (set-port-position! empty (port-position empty))
+ (= 0 (port-position empty)))
+ (begin (get-bytevector-n not-empty 3)
+ (set-port-position! not-empty (port-position not-empty))
+ (= 3 (port-position not-empty))))))
+
(pass-if-exception "make-custom-binary-input-port [wrong-num-args]"
exception:wrong-num-args
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-179-gc89b452,
Andy Wingo <=