aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-18 14:34:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-18 14:35:46 +0900
commit041c2932e336b509b0ddc1fdbd9f160bce8d4893 (patch)
treebfa45f355d5c284f31662bef1b82663f10034b57 /io.c
parent38070ccdeb02022a0d9def239651c82cae9a0e79 (diff)
downloadruby-041c2932e336b509b0ddc1fdbd9f160bce8d4893.tar.gz
Pass keyword arguments to IOs properly [Bug #16639]
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/io.c b/io.c
index 201ec9bede..19fe51bcf6 100644
--- a/io.c
+++ b/io.c
@@ -12430,10 +12430,14 @@ argf_block_call_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, argf))
return Qnil;
}
+#define ARGF_block_call(mid, argc, argv, func, argf) \
+ rb_block_call_kw(ARGF.current_file, mid, argc, argv, \
+ func, argf, rb_keyword_given_p())
+
static void
argf_block_call(ID mid, int argc, VALUE *argv, VALUE argf)
{
- VALUE ret = rb_block_call(ARGF.current_file, mid, argc, argv, argf_block_call_i, argf);
+ VALUE ret = ARGF_block_call(mid, argc, argv, argf_block_call_i, argf);
if (ret != Qundef) ARGF.next_p = 1;
}
@@ -12449,7 +12453,7 @@ argf_block_call_line_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, argf))
static void
argf_block_call_line(ID mid, int argc, VALUE *argv, VALUE argf)
{
- VALUE ret = rb_block_call(ARGF.current_file, mid, argc, argv, argf_block_call_line_i, argf);
+ VALUE ret = ARGF_block_call(mid, argc, argv, argf_block_call_line_i, argf);
if (ret != Qundef) ARGF.next_p = 1;
}