summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 16:53:02 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 16:53:02 +0000
commitc6816d074b89131797e842a312f302037bcfbb9c (patch)
tree608dbc9a13d6c8839cbc37a86b0f848ce3151ad1 /eval.c
parent6df2fbf0f6c4efa68865bec69598894f89d61d0b (diff)
merge revision(s) r41598,r45181:
* eval_error.c (warn_printf): use rb_vsprintf instead so ruby specific extensions like PRIsVALUE can be used in format strings * eval_error.c (error_print): use warn_print_str (alias for rb_write_error_str) to print a string value instead of using RSTRING_PTR and RSTRING_LEN manually * eval.c (setup_exception): use PRIsVALUE instead of %s and RSTRING_PTR * eval.c (setup_exception): preserve exception class name encoding in debug mode messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@45253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/eval.c b/eval.c
index e8dc008a53..78a5d88f2d 100644
--- a/eval.c
+++ b/eval.c
@@ -474,19 +474,16 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
e = rb_obj_as_string(mesg);
th->errinfo = mesg;
if (file && line) {
- warn_printf("Exception `%s' at %s:%d - %s\n",
- rb_obj_classname(th->errinfo),
- file, line, RSTRING_PTR(e));
+ warn_printf("Exception `%"PRIsVALUE"' at %s:%d - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), file, line, e);
}
else if (file) {
- warn_printf("Exception `%s' at %s - %s\n",
- rb_obj_classname(th->errinfo),
- file, RSTRING_PTR(e));
+ warn_printf("Exception `%"PRIsVALUE"' at %s - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), file, e);
}
else {
- warn_printf("Exception `%s' - %s\n",
- rb_obj_classname(th->errinfo),
- RSTRING_PTR(e));
+ warn_printf("Exception `%"PRIsVALUE"' - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), e);
}
}
POP_TAG();