diff options
-rw-r--r-- | error.c | 1 | ||||
-rw-r--r-- | re.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -544,6 +544,7 @@ Init_Exception() rb_define_method(rb_eException, "exception", exc_exception, -1); rb_define_method(rb_eException, "initialize", exc_initialize, -1); rb_define_method(rb_eException, "to_s", exc_to_s, 0); + rb_define_method(rb_eException, "to_str", exc_to_s, 0); rb_define_method(rb_eException, "message", exc_to_s, 0); rb_define_method(rb_eException, "inspect", exc_inspect, 0); rb_define_method(rb_eException, "backtrace", exc_backtrace, 0); @@ -1260,7 +1260,7 @@ rb_reg_initialize_m(argc, argv, self) } else { s = StringValuePtr(argv[0]); - len = RREGEXP(argv[0])->len; + len = RSTRING(argv[0])->len; if (argc >= 2) { if (FIXNUM_P(argv[1])) flags = FIX2INT(argv[1]); else if (RTEST(argv[1])) flags = RE_OPTION_IGNORECASE; |