Skip to content

Commit

Permalink
FIX: write/lines regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Oct 7, 2020
1 parent ce31fd6 commit b440b35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/p-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ REBINT Mode_Syms[] = {
args = Find_Refines(ds, ALL_WRITE_REFS);
spec = D_ARG(2); // data (binary, string, or block)

if (!(IS_BINARY(spec) || IS_STRING(spec))) {
if (!(IS_BINARY(spec) || IS_STRING(spec) || (IS_BLOCK(spec) && (args & AM_WRITE_LINES)))) {
//Trap1(RE_INVALID_ARG, spec);
REB_MOLD mo = {0};
Reset_Mold(&mo);
Expand Down
4 changes: 3 additions & 1 deletion src/tests/units/port-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ if system/platform = 'Windows [
--assert [type: file size: 51732] = query/mode file [type: size:]
close file

--test-- "write/lines - issue/2102"
--test-- "write/lines"
;@@ https://github.com/Oldes/Rebol-issues/issues/2102
write/lines %tmp.txt {a^/}
--assert ["a" ""] = read/lines %tmp.txt
;@@ https://github.com/Oldes/Rebol-issues/issues/2429
--assert "a^/b^/" = read/string write/lines %tmp.txt ["a" "b"]
delete %tmp.txt

--test-- "read/lines - issue/1794"
Expand Down

0 comments on commit b440b35

Please sign in to comment.