summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-15 08:52:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-15 08:52:18 +0000
commit3196645aee3add70a33f3d926d1d6e3820d39377 (patch)
tree326561008f8512e3560810077a2505da6aa6d082 /re.c
parent826f10c6ce5cf11ba57f47f58384f4da58806c35 (diff)
-r debug, -s, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/re.c b/re.c
index ac73732..8bc15c1 100644
--- a/re.c
+++ b/re.c
@@ -261,7 +261,7 @@ rb_reg_source(re)
VALUE re;
{
VALUE str = rb_str_new(0,0);
- rb_reg_expr_str(str, RREGEXP(re)->str,RREGEXP(re)->len);
+ rb_reg_expr_str(str, RREGEXP(re)->str, RREGEXP(re)->len);
return str;
}
@@ -710,7 +710,7 @@ static VALUE
match_string(match)
VALUE match;
{
- return rb_str_dup(RMATCH(match)->str);
+ return RMATCH(match)->str; /* str is frozen */
}
VALUE rb_cRegexp;
@@ -1263,7 +1263,9 @@ Init_Regexp()
rb_global_variable(&reg_cache);
rb_global_variable(&matchcache);
- rb_cMatch = rb_define_class("MatchingData", rb_cData);
+ rb_cMatch = rb_define_class("MatchingData", rb_cObject);
+ rb_undef_method(CLASS_OF(rb_cMatch), "new");
+
rb_define_method(rb_cMatch, "clone", match_clone, 0);
rb_define_method(rb_cMatch, "size", match_size, 0);
rb_define_method(rb_cMatch, "length", match_size, 0);