ruby-changes:37975
From: nobu <ko1@a...>
Date: Sun, 22 Mar 2015 23:32:08 +0900 (JST)
Subject: [ruby-changes:37975] nobu:r50056 (trunk): variable.c: escape erred name
nobu 2015-03-22 23:31:53 +0900 (Sun, 22 Mar 2015) New Revision: 50056 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50056 Log: 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. Modified files: trunk/variable.c Index: variable.c =================================================================== --- variable.c (revision 50055) +++ variable.c (revision 50056) @@ -387,8 +387,8 @@ rb_path_to_class(VALUE pathname) https://github.com/ruby/ruby/blob/trunk/variable.c#L387 } 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)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/