~ chicken-core (chicken-5) f9f9e0f00b7d3341b179dcdc875a6ef4316726ef
commit f9f9e0f00b7d3341b179dcdc875a6ef4316726ef
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Oct 20 12:34:45 2014 +0200
Commit: Mario Domenech Goulart <mario.goulart@gmail.com>
CommitDate: Mon Oct 20 11:24:08 2014 -0200
Use correct variable when updating buffer-location in "read-buffered" for tcp ports.
Signed-off-by: Mario Domenech Goulart <mario.goulart@gmail.com>
diff --git a/tcp.scm b/tcp.scm
index 99745d0f..1652cbce 100644
--- a/tcp.scm
+++ b/tcp.scm
@@ -359,7 +359,6 @@ EOF
(let* ((buf (make-string +input-buffer-size+))
(data (vector fd #f #f buf 0))
(buflen 0)
- (bufpos 0)
(bufindex 0)
(iclosed #f)
(oclosed #f)
@@ -469,8 +468,8 @@ EOF
(lambda (p) ; read-buffered
(if (fx>= bufindex buflen)
""
- (let ((str (##sys#substring buf bufpos buflen)))
- (set! bufpos buflen)
+ (let ((str (##sys#substring buf bufindex buflen)))
+ (set! bufindex buflen)
str)))
) )
(output
Trap