~ chicken-core (master) 4e142a0cbaf3127ba560d2f6817f0b1167876f1d


commit 4e142a0cbaf3127ba560d2f6817f0b1167876f1d
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Thu Dec 4 10:17:06 2025 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Thu Dec 4 10:17:06 2025 +0100

    bugfix in string-copy, reported by "afiw"

diff --git a/library.scm b/library.scm
index e0d2775c..9888facd 100644
--- a/library.scm
+++ b/library.scm
@@ -1891,9 +1891,7 @@ EOF
       (if end
           (##sys#check-range/including end 0 len 'string-copy)
           (set! end len))
-      (let* ((bv (if start
-                     (##sys#substring s start1 end)
-                     (##sys#slot s 0)))
+      (let* ((bv (##sys#slot (if start (##sys#substring s start1 end) s) 0))
              (len (##sys#size bv))
              (n (fx- end start1))
              (bv2 (##sys#make-bytevector len)) )
Trap