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

* re.c (match_array): replace match_check().

* re.c (match_values_at): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-02-03 05:20:27 +00:00
parent 3f59f0e06c
commit 1c400db1d5
2 changed files with 16 additions and 4 deletions

View file

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

14
re.c
View file

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