1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

-r debug, -s, etc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1999-10-15 08:52:18 +00:00
parent 826f10c6ce
commit 3196645aee
12 changed files with 259 additions and 166 deletions

8
re.c
View file

@ -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);