File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -458,10 +458,11 @@ static REBYTE seed_str[SEED_LEN] = {
458
458
// Add missing CRs:
459
459
while (cnt > 0 ) {
460
460
bp [tail -- ] = bp [len ]; // Copy src to dst.
461
- if (bp [len -- ] == LF && bp [len ] != CR ) {
461
+ if (bp [len ] == LF && ( len == 0 || bp [len - 1 ] != CR ) ) {
462
462
bp [tail -- ] = CR ;
463
463
cnt -- ;
464
464
}
465
+ len -- ;
465
466
}
466
467
}
467
468
@@ -495,10 +496,11 @@ static REBYTE seed_str[SEED_LEN] = {
495
496
// Add missing CRs:
496
497
while (cnt > 0 ) {
497
498
bp [tail -- ] = bp [len ]; // Copy src to dst.
498
- if (bp [len -- ] == LF && bp [len ] != CR ) {
499
+ if (bp [len ] == LF && ( len == 0 || bp [len - 1 ] != CR ) ) {
499
500
bp [tail -- ] = CR ;
500
501
cnt -- ;
501
502
}
503
+ len -- ;
502
504
}
503
505
}
504
506
Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ Rebol [
125
125
;@@ https://github.com/Oldes/Rebol-issues/issues/1514
126
126
--assert error? try [try /except [1 / 0 ] :add ] ;- no crash
127
127
128
+ --test-- {enline "^/ "}
129
+ --assert string? enline "^/ " ;- no crash
130
+ --assert string? enline "^/ č" ;- no crash (unicode version)
131
+
128
132
===end-group===
129
133
130
134
~~~end-file~~~
You can’t perform that action at this time.
0 commit comments