Remove cname duplication from exc_inspect().
MODIFY
src/error.c
src/error.c
@@ -166,13 +166,10 @@ exc_inspect(mrb_state *mrb, mrb_value exc)
else {
const char *cname = mrb_obj_classname(mrb, exc);
str = mrb_str_new_cstr(mrb, cname);
- mrb_str_cat_lit(mrb, str, ": ");
if (append_mesg) {
+ mrb_str_cat_lit(mrb, str, ": ");
mrb_str_cat_str(mrb, str, mesg);
}
- else {
- mrb_str_cat_cstr(mrb, str, cname);
- }
}
return str;
}

MODIFY
test/t/exception.rb
test/t/exception.rb
@@ -353,7 +353,7 @@ assert('Exception 19') do
end
assert('Exception#inspect without message') do
- assert_equal "Exception: Exception", Exception.new.inspect
+ assert_equal "Exception", Exception.new.inspect
end
assert('Exception#backtrace') do

Remove cname duplication from exc_inspect().