summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-06 08:10:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-06 08:10:47 +0000
commitb9cafaf5246fb240f52ebfce67ae2b72dd4eb363 (patch)
tree842609f74c880929bf3644ca9101e632341df086 /dir.c
parentc7572f2fe777c96880905ee37ab313cd52b5aa51 (diff)
vm_insnhelper.c: rb_get_kwargs
* vm_insnhelper.c (rb_get_kwargs): get keyword argument values from an option hash, not only checking keys. * dir.c (dir_initialize): use rb_get_kwargs. * gc.c (gc_start_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 99b1caa..8492ce7 100644
--- a/dir.c
+++ b/dir.c
@@ -436,9 +436,8 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
if (!NIL_P(opt)) {
VALUE enc;
- rb_check_keyword_opthash(opt, keyword_ids, 0, 1);
- enc = rb_hash_aref(opt, ID2SYM(keyword_ids[0]));
- if (!NIL_P(enc)) {
+ rb_get_kwargs(opt, keyword_ids, 0, 1, &enc);
+ if (enc != Qundef && !NIL_P(enc)) {
fsenc = rb_to_encoding(enc);
}
}