ruby-changes:21578
From: usa <ko1@a...>
Date: Fri, 4 Nov 2011 02:00:06 +0900 (JST)
Subject: [ruby-changes:21578] usa:r33627 (trunk): * io.c (make_writeconv): unversal_newline converter is for reading.
usa 2011-11-04 01:59:53 +0900 (Fri, 04 Nov 2011) New Revision: 33627 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33627 Log: * 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. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33626) +++ ChangeLog (revision 33627) @@ -1,3 +1,11 @@ +Fri Nov 4 01:56:30 2011 NAKAMURA Usaku <usa@r...> + + * 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. + Fri Nov 4 01:04:48 2011 NARUSE, Yui <naruse@r...> * ext/readline/readline.c (Init_readline): like r18313, libedit's Index: io.c =================================================================== --- io.c (revision 33626) +++ io.c (revision 33627) @@ -910,7 +910,9 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/