From 74768415d8d9eff2c02e0bfc04f2b325ec579e63 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 22 Mar 2015 14:31:53 +0000 Subject: 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 --- variable.c | 4 ++-- 1 file 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)) { -- cgit v1.2.3