aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-22 14:31:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-22 14:31:53 +0000
commit74768415d8d9eff2c02e0bfc04f2b325ec579e63 (patch)
tree5efa5a29c63050930361a6d3130097c8ec12e97f /variable.c
parentd54bedb7f83e3a307adaae4ff575e0b325375907 (diff)
downloadruby-74768415d8d9eff2c02e0bfc04f2b325ec579e63.tar.gz
variable.c: escape erred name
* variable.c (rb_path_to_class): escape erred name. as precision delimits the formatted result only, not region of an argument string, need to make a substring for the particular region. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/variable.c b/variable.c
index 1845e38b60..c78803a55c 100644
--- a/variable.c
+++ b/variable.c
@@ -387,8 +387,8 @@ rb_path_to_class(VALUE pathname)
}
if (!id || !rb_const_defined_at(c, id)) {
undefined_class:
- rb_raise(rb_eArgError, "undefined class/module %.*"PRIsVALUE,
- (int)(p-path), pathname);
+ rb_raise(rb_eArgError, "undefined class/module % "PRIsVALUE,
+ rb_str_subseq(pathname, 0, p-path));
}
c = rb_const_get_at(c, id);
if (!RB_TYPE_P(c, T_MODULE) && !RB_TYPE_P(c, T_CLASS)) {