ruby-changes:21611
From: tarui <ko1@a...>
Date: Tue, 8 Nov 2011 01:34:18 +0900 (JST)
Subject: [ruby-changes:21611] tarui:r33660 (ruby_1_9_3): * io.c (make_writeconv): unversal_newline converter is for reading.
tarui 2011-11-08 01:33:51 +0900 (Tue, 08 Nov 2011) New Revision: 33660 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33660 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: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/io.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33659) +++ ruby_1_9_3/ChangeLog (revision 33660) @@ -1,6 +1,14 @@ +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. + Mon Nov 7 23:39:23 2011 Tajima Akio <artonx@y...> - * io.c (io_fflush): remove fsync(). + * io.c (io_fflush): remove fsync(). * io.c (rb_io_flush, rb_io_rewind): fsync() here. These pathces are backports of trunk r33651 for [Bug #5585] Index: ruby_1_9_3/io.c =================================================================== --- ruby_1_9_3/io.c (revision 33659) +++ ruby_1_9_3/io.c (revision 33660) @@ -754,8 +754,11 @@ 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 if (!fptr->encs.enc || (fptr->encs.enc == rb_ascii8bit_encoding() && !fptr->encs.enc2)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/