From 2c8f16e6c0ca8ae886615c048ee14d362bac05f8 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 24 Apr 2018 12:25:46 +0000 Subject: string.c: fix scanned substring with `\K` * string.c (scan_once): fix the matched substring with `\K`, the beginning of that string may differ from the matched position. [ruby-core:86663] [Bug #14707] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 1 + 1 file changed, 1 insertion(+) (limited to 'string.c') diff --git a/string.c b/string.c index ad9ba6f355..f989466d32 100644 --- a/string.c +++ b/string.c @@ -9046,6 +9046,7 @@ scan_once(VALUE str, VALUE pat, long *start, int set_backref_str) else { match = rb_backref_get(); regs = RMATCH_REGS(match); + pos = BEG(0); end = END(0); } if (pos == end) { -- cgit v1.2.3