vm_backtrace.c: unknown name method
* vm_backtrace.c (location_format): adjust unknown name method results to other functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1c90afbc1a
commit
2d1578804b
@ -288,14 +288,18 @@ location_absolute_path_m(VALUE self)
|
|||||||
static VALUE
|
static VALUE
|
||||||
location_format(VALUE file, int lineno, VALUE name)
|
location_format(VALUE file, int lineno, VALUE name)
|
||||||
{
|
{
|
||||||
|
VALUE s = rb_enc_sprintf(rb_enc_compatible(file, name), "%s", RSTRING_PTR(file));
|
||||||
if (lineno != 0) {
|
if (lineno != 0) {
|
||||||
return rb_enc_sprintf(rb_enc_compatible(file, name), "%s:%d:in `%s'",
|
rb_str_catf(s, ":%d", lineno);
|
||||||
RSTRING_PTR(file), lineno, RSTRING_PTR(name));
|
}
|
||||||
|
rb_str_cat_cstr(s, ":in ");
|
||||||
|
if (NIL_P(name)) {
|
||||||
|
rb_str_cat_cstr(s, "unknown method");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return rb_enc_sprintf(rb_enc_compatible(file, name), "%s:in `%s'",
|
rb_str_catf(s, "`%s'", RSTRING_PTR(name));
|
||||||
RSTRING_PTR(file), RSTRING_PTR(name));
|
|
||||||
}
|
}
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user