Attached the patch to fix get-bytevector-all.
You may check it like this:
(get-bytevector-all (current-input-port))

And try to input then type ctrl+d, the current implementation needs you
type ctrl+d twice.

Regards.
>From 1e22ce9468a09a186ce77552bae310d2e4a6178d Mon Sep 17 00:00:00 2001
From: Nala Ginrut <nalagin...@gmail.com>
Date: Thu, 14 Mar 2013 17:24:58 +0800
Subject: [PATCH] Fix get-bytevector-all read redundant eof.

---
 libguile/r6rs-ports.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index e867429..c812979 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -644,7 +644,7 @@ SCM_DEFINE (scm_get_bytevector_all, "get-bytevector-all", 1, 0, 0,
   c_bv = (char *) scm_gc_malloc_pointerless (c_len, SCM_GC_BYTEVECTOR);
   c_total = c_read = 0;
 
-  do
+  while (!SCM_EOF_OBJECT_P (scm_peek_char (port)))
     {
       if (c_total + c_read > c_len)
 	{
@@ -660,7 +660,6 @@ SCM_DEFINE (scm_get_bytevector_all, "get-bytevector-all", 1, 0, 0,
       c_read = scm_c_read (port, c_bv + c_total, c_count);
       c_total += c_read, c_count -= c_read;
     }
-  while (!SCM_EOF_OBJECT_P (scm_peek_char (port)));
 
   if (c_total == 0)
     {
-- 
1.7.10.4

Reply via email to