summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 483c8beafc..f9867e44d7 100644
--- a/dir.c
+++ b/dir.c
@@ -390,11 +390,10 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
}
fsenc = rb_filesystem_encoding();
- rb_scan_args(argc, argv, "11", &dirname, &opt);
+ argc = rb_scan_args(argc, argv, "1:", &dirname, &opt);
if (!NIL_P(opt)) {
VALUE v, enc=Qnil;
- opt = rb_convert_type(opt, T_HASH, "Hash", "to_hash");
v = rb_hash_aref(opt, sym_enc);
if (!NIL_P(v)) enc = v;