ruby-changes:58006
From: Nobuyoshi <ko1@a...>
Date: Sun, 29 Sep 2019 18:59:49 +0900 (JST)
Subject: [ruby-changes:58006] 7fe253f47f (master): [ruby/stringio] Use rb_funcallv_kw when delegating arguments
https://git.ruby-lang.org/ruby.git/commit/?id=7fe253f47f From 7fe253f47f55f69069fc0e03879a3a2b55aee408 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 29 Sep 2019 18:06:02 +0900 Subject: [ruby/stringio] Use rb_funcallv_kw when delegating arguments https://github.com/ruby/stringio/commit/5892663e32 diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 6e75406..8c76657 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -26,6 +26,11 @@ https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L26 # define RB_INTEGER_TYPE_P(c) (FIXNUM_P(c) || RB_TYPE_P(c, T_BIGNUM)) #endif +#ifndef RB_PASS_CALLED_KEYWORDS +# define rb_funcallv_kw(recv, mid, arg, argv, kw_splat) rb_funcallv(recv, mid, arg, argv) +# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass) +#endif + #ifndef HAVE_RB_IO_EXTRACT_MODEENC #define rb_io_extract_modeenc strio_extract_modeenc static void @@ -1309,7 +1314,7 @@ strio_gets(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1314 static VALUE strio_readline(int argc, VALUE *argv, VALUE self) { - VALUE line = rb_funcallv(self, rb_intern("gets"), argc, argv); + VALUE line = rb_funcallv_kw(self, rb_intern("gets"), argc, argv, RB_PASS_CALLED_KEYWORDS); if (NIL_P(line)) rb_eof_error(); return line; } @@ -1589,7 +1594,7 @@ strio_read(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1594 static VALUE strio_sysread(int argc, VALUE *argv, VALUE self) { - VALUE val = rb_funcallv(self, rb_intern("read"), argc, argv); + VALUE val = rb_funcallv_kw(self, rb_intern("read"), argc, argv, RB_PASS_CALLED_KEYWORDS); if (NIL_P(val)) { rb_eof_error(); } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/