summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-24 00:48:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-24 00:48:15 +0000
commit483c7290f2509a9d5a3e193a66689971394d4de8 (patch)
treeedb5f34e8752a4b5e7e69ad5b4f15dd9643fcc9b /enumerator.c
parent5c3be90ae09f03f412cde51dc500da51827aafe7 (diff)
enumerator.c: fix inspect with the last empty hash
[ruby-core:90685] [Bug #15455] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c
index 021daeb..609fc71 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -1105,7 +1105,7 @@ append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args)
rb_str_buf_cat2(str, "(");
- if (RB_TYPE_P(argv[argc-1], T_HASH)) {
+ if (RB_TYPE_P(argv[argc-1], T_HASH) && !RHASH_EMPTY_P(argv[argc-1])) {
int all_key = TRUE;
rb_hash_foreach(argv[argc-1], key_symbol_p, (VALUE)&all_key);
if (all_key) kwds = argv[--argc];