| 1 | *** /tmp/srfi-13/srfi-13.scm 2021-02-26 21:02:34.548224172 -0500
|
|---|
| 2 | --- /home/dieggsy/.cache/chicken-install/srfi-13/srfi-13.scm 2021-02-26 21:02:49.951557564 -0500
|
|---|
| 3 | ***************
|
|---|
| 4 | *** 1935,1948 ****
|
|---|
| 5 | (nleft (- total-chars ncopied)) ; # chars left to copy.
|
|---|
| 6 | (nspans (quotient nleft slen))) ; # whole spans to copy
|
|---|
| 7 |
|
|---|
| 8 | ! ;; Copy the whole spans in the middle.
|
|---|
| 9 | ! (do ((i (+ tstart ncopied) (+ i slen)) ; Current target index.
|
|---|
| 10 | ! (nspans nspans (- nspans 1))) ; # spans to copy
|
|---|
| 11 | ! ((zero? nspans)
|
|---|
| 12 | ! ;; Copy the partial-span @ the end & we're done.
|
|---|
| 13 | ! (%string-copy! target i s start (+ start (- total-chars (- i tstart)))))
|
|---|
| 14 |
|
|---|
| 15 | ! (%string-copy! target i s start end))))); Copy a whole span.
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | |
|---|
| 19 |
|
|---|
| 20 | --- 1935,1950 ----
|
|---|
| 21 | (nleft (- total-chars ncopied)) ; # chars left to copy.
|
|---|
| 22 | (nspans (quotient nleft slen))) ; # whole spans to copy
|
|---|
| 23 |
|
|---|
| 24 | ! (if (negative? nleft) ;; Total length is shorter that original string
|
|---|
| 25 | ! target
|
|---|
| 26 | ! ;; Copy the whole spans in the middle.
|
|---|
| 27 | ! (do ((i (+ tstart ncopied) (+ i slen)) ; Current target index.
|
|---|
| 28 | ! (nspans nspans (- nspans 1))) ; # spans to copy
|
|---|
| 29 | ! ((zero? nspans)
|
|---|
| 30 | ! ;; Copy the partial-span @ the end & we're done.
|
|---|
| 31 | ! (%string-copy! target i s start (+ start (- total-chars (- i tstart)))))
|
|---|
| 32 |
|
|---|
| 33 | ! (%string-copy! target i s start end)))))); Copy a whole span.
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | |
|---|
| 37 |
|
|---|