mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
error.c: VALUE to messages
* error.c (name_err_mesg_to_str, syserr_initialize): use VALUE to format messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a3d7236cd
commit
427bcc40ac
1 changed files with 2 additions and 3 deletions
5
error.c
5
error.c
|
@ -1097,7 +1097,7 @@ name_err_mesg_to_str(VALUE obj)
|
|||
if (desc && desc[0] != '#') {
|
||||
d = d ? rb_str_dup(d) : rb_str_new2(desc);
|
||||
rb_str_cat2(d, ":");
|
||||
rb_str_cat2(d, rb_obj_classname(obj));
|
||||
rb_str_append(d, rb_class_name(CLASS_OF(obj)));
|
||||
}
|
||||
args[0] = mesg;
|
||||
args[1] = ptr[2];
|
||||
|
@ -1246,8 +1246,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
|
|||
VALUE str = StringValue(mesg);
|
||||
rb_encoding *me = rb_enc_get(mesg);
|
||||
|
||||
mesg = rb_sprintf("%s - %.*s", err,
|
||||
(int)RSTRING_LEN(str), RSTRING_PTR(str));
|
||||
mesg = rb_sprintf("%s - %"PRIsVALUE, err, mesg);
|
||||
if (le != me && rb_enc_asciicompat(me)) {
|
||||
le = me;
|
||||
}/* else assume err is non ASCII string. */
|
||||
|
|
Loading…
Add table
Reference in a new issue