Skip to content

Commit b440b35

Browse files
committed
FIX: write/lines regression
fixes: Oldes/Rebol-issues#2429
1 parent ce31fd6 commit b440b35

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/core/p-file.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ REBINT Mode_Syms[] = {
454454
args = Find_Refines(ds, ALL_WRITE_REFS);
455455
spec = D_ARG(2); // data (binary, string, or block)
456456

457-
if (!(IS_BINARY(spec) || IS_STRING(spec))) {
457+
if (!(IS_BINARY(spec) || IS_STRING(spec) || (IS_BLOCK(spec) && (args & AM_WRITE_LINES)))) {
458458
//Trap1(RE_INVALID_ARG, spec);
459459
REB_MOLD mo = {0};
460460
Reset_Mold(&mo);

src/tests/units/port-test.r3

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ if system/platform = 'Windows [
108108
--assert [type: file size: 51732] = query/mode file [type: size:]
109109
close file
110110

111-
--test-- "write/lines - issue/2102"
111+
--test-- "write/lines"
112112
;@@ https://github.com/Oldes/Rebol-issues/issues/2102
113113
write/lines %tmp.txt {a^/}
114114
--assert ["a" ""] = read/lines %tmp.txt
115+
;@@ https://github.com/Oldes/Rebol-issues/issues/2429
116+
--assert "a^/b^/" = read/string write/lines %tmp.txt ["a" "b"]
115117
delete %tmp.txt
116118

117119
--test-- "read/lines - issue/1794"

0 commit comments

Comments
 (0)