* 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
This commit is contained in:
nobu 2011-04-29 01:24:54 +00:00
parent 7ff7a2b376
commit 85c1d5d41d
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Fri Apr 29 10:24:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (make_writeconv): do not add textmode newline decorator if any
newline decorator is set already. fixes #4618, fixes #4619
Fri Apr 29 10:17:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (lock_func): small cleanup.

3
io.c
View File

@ -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