summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c2
1 files changed, 1 insertions, 1 deletions
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);
}