aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 328abc7ea8..b479f33cd5 100644
--- a/io.c
+++ b/io.c
@@ -789,7 +789,8 @@ make_writeconv(rb_io_t *fptr)
ecflags = fptr->encs.ecflags;
ecopts = fptr->encs.ecopts;
#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
- if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr))
+ if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) &&
+ !(ecflags & ECONV_NEWLINE_DECORATOR_MASK))
ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
#endif