diff --git a/ChangeLog b/ChangeLog index cea517f3f4..bf725bbee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 9 05:17:48 2002 Akinori MUSHA + + * re.c (match_select): fix index references and make + MatchData#select actually work. + Mon Apr 8 04:50:51 2002 Nobuyoshi Nakada * eval.c (error_handle): default to 1 unless status is set. diff --git a/re.c b/re.c index b7603e0f29..d3abf098e8 100644 --- a/re.c +++ b/re.c @@ -841,7 +841,7 @@ match_select(argc, argv, match) rb_ary_push(result, Qnil); } else { - VALUE str = rb_str_new(ptr+regs->beg[i], regs->end[i]-regs->beg[i]); + VALUE str = rb_str_new(ptr+regs->beg[idx], regs->end[idx]-regs->beg[idx]); if (taint) OBJ_TAINT(str); rb_ary_push(result, str); }