aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/io.c b/io.c
index 55959802a4..f6e8bfb5ce 100644
--- a/io.c
+++ b/io.c
@@ -5932,11 +5932,7 @@ open_key_args(int argc, VALUE *argv, struct foreach_arg *arg)
}
v = rb_hash_aref(opt, mode);
if (!NIL_P(v)) {
- VALUE args[2];
-
- args[0] = argv[0];
- args[1] = v;
- arg->io = rb_f_open(2, args);
+ arg->io = rb_io_open(RSTRING_PTR(argv[0]), StringValueCStr(v));
}
if (!arg->io) {