summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index d4ec257e87..c2cdd0051a 100644
--- a/string.c
+++ b/string.c
@@ -8216,11 +8216,12 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str)
struct re_registers *regs;
VALUE match = 0;
- for (; (end = rb_reg_search(spat, str, start, 0)) >= 0;
+ for (; rb_reg_search(spat, str, start, 0) >= 0;
(match ? (rb_match_unbusy(match), rb_backref_set(match)) : (void)0)) {
match = rb_backref_get();
if (!result) rb_match_busy(match);
regs = RMATCH_REGS(match);
+ end = BEG(0);
if (start == end && BEG(0) == END(0)) {
if (!ptr) {
SPLIT_STR(0, 0);