diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-03 16:59:53 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-03 16:59:53 +0000 |
commit | 932d63efe08fc0d2a69ea81676508a62a2c981b2 (patch) | |
tree | 73c05b262d645bb61ca04fa115cc11bf90505eab /io.c | |
parent | b2f90f4d511082c219ba446afce59d55d26d8280 (diff) | |
download | ruby-932d63efe08fc0d2a69ea81676508a62a2c981b2.tar.gz |
* io.c (make_writeconv): unversal_newline converter is for reading.
so, if the io is text mode and has ECONV_UNIVERSAL_NEWLINE_DECORATOR
flag, use crlf_newline converter for writing.
this change fixes the problem about the luck of CR up Kernel.p and
Kernel.puts to stdout/stderr on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -910,7 +910,9 @@ make_writeconv(rb_io_t *fptr) ecopts = fptr->encs.ecopts; #ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) && - !(ecflags & ECONV_NEWLINE_DECORATOR_MASK)) + (!(ecflags & ECONV_NEWLINE_DECORATOR_MASK)) || + (ecflags & ECONV_UNIVERSAL_NEWLINE_DECORATOR)) + ecflags &= ~ECONV_UNIVERSAL_NEWLINE_DECORATOR; ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE; #endif |