summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/object.c b/object.c
index fce1ea3c36..a7dd8c6685 100644
--- a/object.c
+++ b/object.c
@@ -2083,12 +2083,14 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
rb_scan_args(argc, argv, "11", &name, &recur);
}
- id = rb_check_id(&name);
- if (id) {
+ if (SYMBOL_P(name)) {
+ id = ID2SYM(name);
if (!rb_is_const_id(id)) goto wrong_id;
return RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
}
+ name = StringValue(name);
+
enc = rb_enc_get(name);
path = RSTRING_PTR(name);