summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--error.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ec8b0cc..68a171c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * error.c: Exception#to_s should actually call to_s.
+
Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
* addr2line.c (get_nth_dirname): decrement the directory index
diff --git a/error.c b/error.c
index b58f0f7..217740f 100644
--- a/error.c
+++ b/error.c
@@ -522,9 +522,12 @@ static VALUE
exc_to_s(VALUE exc)
{
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
+ VALUE r = Qnil;
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
- return rb_String(mesg);
+ r = rb_String(mesg);
+ OBJ_INFECT(r, exc);
+ return r;
}
/*