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

* re.c (match_select): fix index references and make

MatchData#select actually work.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2002-04-08 20:21:14 +00:00
parent 2a255514a1
commit f240fc637c
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Apr 9 05:17:48 2002 Akinori MUSHA <knu@iDaemons.org>
* re.c (match_select): fix index references and make
MatchData#select actually work.
Mon Apr 8 04:50:51 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp> Mon Apr 8 04:50:51 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* eval.c (error_handle): default to 1 unless status is set. * eval.c (error_handle): default to 1 unless status is set.

2
re.c
View file

@ -841,7 +841,7 @@ match_select(argc, argv, match)
rb_ary_push(result, Qnil); rb_ary_push(result, Qnil);
} }
else { 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); if (taint) OBJ_TAINT(str);
rb_ary_push(result, str); rb_ary_push(result, str);
} }