*** /tmp/srfi-13/srfi-13.scm	2021-02-26 21:02:34.548224172 -0500
--- /home/dieggsy/.cache/chicken-install/srfi-13/srfi-13.scm	2021-02-26 21:02:49.951557564 -0500
***************
*** 1935,1948 ****
             (nleft (- total-chars ncopied))      ; # chars left to copy.
             (nspans (quotient nleft slen)))      ; # whole spans to copy
  
!       ;; Copy the whole spans in the middle.
!       (do ((i (+ tstart ncopied) (+ i slen))    ; Current target index.
!            (nspans nspans (- nspans 1)))        ; # spans to copy
!           ((zero? nspans)
!            ;; Copy the partial-span @ the end & we're done.
!            (%string-copy! target i s start (+ start (- total-chars (- i tstart)))))
  
!         (%string-copy! target i s start end))))); Copy a whole span.
  
  
  
--- 1935,1950 ----
             (nleft (- total-chars ncopied))      ; # chars left to copy.
             (nspans (quotient nleft slen)))      ; # whole spans to copy
  
!       (if (negative? nleft) ;; Total length is shorter that original string
!           target
!           ;; Copy the whole spans in the middle.
!           (do ((i (+ tstart ncopied) (+ i slen))    ; Current target index.
!                (nspans nspans (- nspans 1)))        ; # spans to copy
!               ((zero? nspans)
!                ;; Copy the partial-span @ the end & we're done.
!                (%string-copy! target i s start (+ start (- total-chars (- i tstart)))))
  
!             (%string-copy! target i s start end)))))); Copy a whole span.
  
  
  
