summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 0328d9d1aa..c3b07442ff 100644
--- a/hash.c
+++ b/hash.c
@@ -1673,6 +1673,11 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
VALUE ary;
ary = rb_hash_to_a(hash);
+ if (argc == 0) {
+ argc = 1;
+ tmp = INT2FIX(1);
+ argv = &tmp;
+ }
rb_funcall2(ary, rb_intern("flatten!"), argc, argv);
return ary;
}