| 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 | --- 1935,1950 ---- |
|---|
| 20 | (nleft (- total-chars ncopied)) ; # chars left to copy. |
|---|
| 21 | (nspans (quotient nleft slen))) ; # whole spans to copy |
|---|
| 22 | |
|---|
| 23 | ! (if (negative? nleft) ;; Total length is shorter that original string |
|---|
| 24 | ! target |
|---|
| 25 | ! ;; Copy the whole spans in the middle. |
|---|
| 26 | ! (do ((i (+ tstart ncopied) (+ i slen)) ; Current target index. |
|---|
| 27 | ! (nspans nspans (- nspans 1))) ; # spans to copy |
|---|
| 28 | ! ((zero? nspans) |
|---|
| 29 | ! ;; Copy the partial-span @ the end & we're done. |
|---|
| 30 | ! (%string-copy! target i s start (+ start (- total-chars (- i tstart))))) |
|---|
| 31 | |
|---|
| 32 | ! (%string-copy! target i s start end)))))); Copy a whole span. |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|