[前][次][番号順一覧][スレッド一覧]

ruby-changes:49201

From: nobu <ko1@a...>
Date: Mon, 18 Dec 2017 16:10:21 +0900 (JST)
Subject: [ruby-changes:49201] nobu:r61319 (trunk): io.c: open generic in binread

nobu	2017-12-18 16:10:15 +0900 (Mon, 18 Dec 2017)

  New Revision: 61319

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61319

  Log:
    io.c: open generic in binread
    
    * io.c (rb_io_s_binread): fix r61317, unintentional change.
    
    From: Nobuyoshi Nakada <nobu@r...>

  Modified files:
    trunk/io.c
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 61318)
+++ test/ruby/test_io.rb	(revision 61319)
@@ -2188,9 +2188,15 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2188
     assert_warn(/invoke external command/) do
       File.read("|#{EnvUtil.rubybin} -e puts")
     end
+    assert_warn(/invoke external command/) do
+      File.binread("|#{EnvUtil.rubybin} -e puts")
+    end
     assert_raise_with_message(ArgumentError, /invoke external command/) do
       Class.new(IO).read("|#{EnvUtil.rubybin} -e puts")
     end
+    assert_raise_with_message(ArgumentError, /invoke external command/) do
+      Class.new(IO).binread("|#{EnvUtil.rubybin} -e puts")
+    end
   end
 
   def test_reopen
Index: io.c
===================================================================
--- io.c	(revision 61318)
+++ io.c	(revision 61319)
@@ -10420,7 +10420,7 @@ rb_io_s_binread(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/io.c#L10420
     rb_scan_args(argc, argv, "12", NULL, NULL, &offset);
     FilePathValue(argv[0]);
     convconfig.enc = rb_ascii8bit_encoding();
-    arg.io = rb_file_open_generic(io_alloc(io), argv[0], oflags, fmode, &convconfig, 0);
+    arg.io = rb_io_open_generic(io, argv[0], oflags, fmode, &convconfig, 0);
     if (NIL_P(arg.io)) return Qnil;
     arg.argv = argv+1;
     arg.argc = (argc > 1) ? 1 : 0;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]