chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] srfi-13 patch


From: Ashley Bone
Subject: [Chicken-users] srfi-13 patch
Date: Thu, 08 Sep 2005 15:48:49 -0500
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

The implementation of string-concatenate-reverse/shared from SRFI-13
has a small bug which the attached patch fixes.

To see the bug, just try:

(use srfi-13)
(string-concatenate-reverse/shared (list "longerstring" "short"))

You'll see some unexpected padding in the result.

later,

ashley
--- srfi-13-orig.scm    2005-09-08 15:21:40.325260800 -0500
+++ srfi-13.scm 2005-09-08 15:22:18.329908800 -0500
@@ -1689,7 +1689,7 @@
     ;; string starts.
     (let lp ((len 0) (nzlist #f) (lis string-list))
       (if (pair? lis)
-         (let ((slen (string-length (car string-list))))
+         (let ((slen (string-length (car lis))))
            (lp (+ len slen)
                (if (or nzlist (zero? slen)) nzlist lis)
                (cdr lis)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]