зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
d54bedb7f8
Коммит
74768415d8
|
@ -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)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче