summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--error.c1
-rw-r--r--re.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/error.c b/error.c
index 8b6b324954..7befc7b8ee 100644
--- a/error.c
+++ b/error.c
@@ -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);
diff --git a/re.c b/re.c
index 9b78681454..830a227732 100644
--- a/re.c
+++ b/re.c
@@ -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;