diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | re.c | 14 |
2 files changed, 16 insertions, 4 deletions
@@ -3,6 +3,12 @@ Tue Feb 3 14:12:10 2009 Shugo Maeda <shugo@ruby-lang.org> * lib/net/imap.rb: validate data before sending to a server. [ruby-core:20320] +Tue Feb 3 12:35:41 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * re.c (match_array): replace match_check(). + + * re.c (match_values_at): ditto. + Tue Feb 3 12:09:08 2009 Shugo Maeda <shugo@ruby-lang.org> * lib/net/imap.rb (hmac_md5): should use String#ord to get ascii @@ -1518,13 +1518,17 @@ last_paren_match_getter(void) static VALUE match_array(VALUE match, int start) { - struct re_registers *regs = RMATCH_REGS(match); - VALUE ary = rb_ary_new2(regs->num_regs); - VALUE target = RMATCH(match)->str; + struct re_registers *regs; + VALUE ary; + VALUE target; int i; int taint = OBJ_TAINTED(match); match_check(match); + regs = RMATCH_REGS(match); + ary = rb_ary_new2(regs->num_regs); + target = RMATCH(match)->str; + for (i=start; i<regs->num_regs; i++) { if (regs->beg[i] == -1) { rb_ary_push(ary, Qnil); @@ -1697,8 +1701,10 @@ match_entry(VALUE match, long n) static VALUE match_values_at(int argc, VALUE *argv, VALUE match) { - struct re_registers *regs = RMATCH_REGS(match); + struct re_registers *regs; + match_check(match); + regs = RMATCH_REGS(match); return rb_get_values_at(match, regs->num_regs, argc, argv, match_entry); } |