summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-24 13:03:35 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-24 13:03:35 +0000
commit0e8807dba53cf37fd79f98fb0e088d6654ae4ba8 (patch)
tree385d54d2b9c8ff75fa48133bc8085be39a666a6c /eval.c
parentfff358989970b6ac2d4e5971ee98ca1f8a32d639 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41598 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 da4d01a84d..00bddb51ac 100644
--- a/eval.c
+++ b/eval.c
@@ -479,19 +479,16 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
if ((status = EXEC_TAG()) == 0) {
RB_GC_GUARD(e) = rb_obj_as_string(e);
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 `%s' at %s:%d - %"PRIsVALUE"\n",
+ rb_obj_classname(th->errinfo), 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 `%s' at %s - %"PRIsVALUE"\n",
+ rb_obj_classname(th->errinfo), file, e);
}
else {
- warn_printf("Exception `%s' - %s\n",
- rb_obj_classname(th->errinfo),
- RSTRING_PTR(e));
+ warn_printf("Exception `%s' - %"PRIsVALUE"\n",
+ rb_obj_classname(th->errinfo), e);
}
}
POP_TAG();