ruby-changes:23775
From: naruse <ko1@a...>
Date: Mon, 28 May 2012 11:40:46 +0900 (JST)
Subject: [ruby-changes:23775] naruse:r35826 (ruby_1_9_3): merge revision(s) 34753:
naruse 2012-05-28 11:40:32 +0900 (Mon, 28 May 2012) New Revision: 35826 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35826 Log: merge revision(s) 34753: * io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055] Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/io.c branches/ruby_1_9_3/test/ruby/test_io.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 35825) +++ ruby_1_9_3/ChangeLog (revision 35826) @@ -1,3 +1,8 @@ +Mon May 28 11:40:19 2012 Nobuyoshi Nakada <nobu@r...> + + * io.c (rb_io_extract_modeenc): fail only if conflicting + text/binary modes given explicitly. [ruby-dev:45268][Bug #6055] + Fri May 25 17:18:06 2012 Nobuyoshi Nakada <nobu@r...> * parse.y (f_arglist): should reset lexical states after empty Index: ruby_1_9_3/io.c =================================================================== --- ruby_1_9_3/io.c (revision 35825) +++ ruby_1_9_3/io.c (revision 35826) @@ -4700,7 +4700,7 @@ vmode_handle: if (NIL_P(vmode)) { - fmode = FMODE_READABLE | DEFAULT_TEXTMODE; + fmode = FMODE_READABLE; oflags = O_RDONLY; } else if (!NIL_P(intmode = rb_check_to_integer(vmode, "to_int"))) { @@ -4747,6 +4747,11 @@ if (fmode & FMODE_BINMODE) oflags |= O_BINARY; #endif +#if DEFAULT_TEXTMODE + else if (NIL_P(vmode)) { + fmode |= DEFAULT_TEXTMODE; + } +#endif if (!has_vmode) { v = rb_hash_aref(opthash, sym_mode); if (!NIL_P(v)) { Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 35825) +++ ruby_1_9_3/version.h (revision 35826) @@ -1,10 +1,10 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 231 +#define RUBY_PATCHLEVEL 232 -#define RUBY_RELEASE_DATE "2012-05-25" +#define RUBY_RELEASE_DATE "2012-05-28" #define RUBY_RELEASE_YEAR 2012 #define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 25 +#define RUBY_RELEASE_DAY 28 #include "ruby/version.h" Index: ruby_1_9_3/test/ruby/test_io.rb =================================================================== --- ruby_1_9_3/test/ruby/test_io.rb (revision 35825) +++ ruby_1_9_3/test/ruby/test_io.rb (revision 35826) @@ -1951,16 +1951,19 @@ def test_open_mode feature4742 = "[ruby-core:36338]" + bug6055 = '[ruby-dev:45268]' mkcdtmpdir do - refute_nil(f = File.open('symbolic', 'w')) + assert_not_nil(f = File.open('symbolic', 'w')) f.close - refute_nil(f = File.open('numeric', File::WRONLY|File::TRUNC|File::CREAT)) + assert_not_nil(f = File.open('numeric', File::WRONLY|File::TRUNC|File::CREAT)) f.close - refute_nil(f = File.open('hash-symbolic', :mode => 'w')) + assert_not_nil(f = File.open('hash-symbolic', :mode => 'w')) f.close - refute_nil(f = File.open('hash-numeric', :mode => File::WRONLY|File::TRUNC|File::CREAT), feature4742) + assert_not_nil(f = File.open('hash-numeric', :mode => File::WRONLY|File::TRUNC|File::CREAT), feature4742) f.close + assert_nothing_raised(bug6055) {f = File.open('hash-symbolic', binmode: true)} + f.close end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/