aboutsummaryrefslogtreecommitdiffstats
path: root/compar.c
diff options
context:
space:
mode:
Diffstat (limited to 'compar.c')
-rw-r--r--compar.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/compar.c b/compar.c
index 893cde79fc..a38668edf1 100644
--- a/compar.c
+++ b/compar.c
@@ -18,17 +18,16 @@ static ID cmp;
void
rb_cmperr(VALUE x, VALUE y)
{
- const char *classname;
+ VALUE classname;
if (SPECIAL_CONST_P(y)) {
- y = rb_inspect(y);
- classname = StringValuePtr(y);
+ classname = rb_inspect(y);
}
else {
- classname = rb_obj_classname(y);
+ classname = rb_class_path(rb_obj_class(y));
}
- rb_raise(rb_eArgError, "comparison of %s with %s failed",
- rb_obj_classname(x), classname);
+ rb_raise(rb_eArgError, "comparison of %"PRIsVALUE" with %"PRIsVALUE" failed",
+ rb_class_path(rb_obj_class(x)), classname);
}
static VALUE