From f072d4e34a70d79a78d06616aad3658dd6b97141 Mon Sep 17 00:00:00 2001 From: knu Date: Sat, 31 May 2008 11:44:49 +0000 Subject: Merge from ruby_1_8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- re.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index ae5473ed0a..a060f27edb 100644 --- a/re.c +++ b/re.c @@ -595,7 +595,7 @@ static VALUE rb_reg_kcode_m(re) VALUE re; { - char *kcode; + const char *kcode; if (FL_TEST(re, KCODE_FIXED)) { switch (RBASIC(re)->flags & KCODE_MASK) { @@ -1340,7 +1340,7 @@ match_string(match) static VALUE match_inspect(VALUE match) { - char *cname = rb_obj_classname(match); + const char *cname = rb_obj_classname(match); VALUE str; int i; struct re_registers *regs = RMATCH(match)->regs; @@ -1477,8 +1477,9 @@ rb_reg_regcomp(str) case_cache = ruby_ignorecase; kcode_cache = reg_kcode; - return reg_cache = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, - ruby_ignorecase); + reg_cache = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, ruby_ignorecase); + RB_GC_GUARD(save_str); + return reg_cache; } static int -- cgit v1.2.3