summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-29 01:24:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-29 01:24:54 +0000
commit85c1d5d41d8c6d045fb74f3ee09f59d80175c614 (patch)
tree497c674d1d24d1c10227f054d902a80c3e0ac910 /io.c
parent7ff7a2b376478fe3377a9c2dfdea43e3dde326ff (diff)
* io.c (make_writeconv): do not add textmode newline decorator if any
newline decorator is set already. fixes #4618, fixes #4619 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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