diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -8484,10 +8484,11 @@ static VALUE rb_io_s_foreach(int argc, VALUE *argv, VALUE self) { VALUE opt; + int orig_argc = argc; struct foreach_arg arg; argc = rb_scan_args(argc, argv, "13:", NULL, NULL, NULL, NULL, &opt); - RETURN_ENUMERATOR(self, argc, argv); + RETURN_ENUMERATOR(self, orig_argc, argv); open_key_args(argc, argv, opt, &arg); if (NIL_P(arg.io)) return Qnil; return rb_ensure(io_s_foreach, (VALUE)&arg, rb_io_close, arg.io); |