summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-07-19 20:07:56 +0100
committerDavid Mitchell <davem@iabyn.com>2013-07-28 10:33:39 +0100
commit3ff69bd60a3227fd6f6dbd653d028e5b4c5e86f9 (patch)
tree40b7b0ab13b8a23cf2b4b52a338f0d394961d99b /regexec.c
parente322109a5f2971453e7404fd28ea1c8245701578 (diff)
downloadperl-3ff69bd60a3227fd6f6dbd653d028e5b4c5e86f9.tar.gz
fix build under -DPERL_NO_COW
An earlier commit in this branch fixed up capturing on intuit-only matches. However, the new code grabbed the buffer before setting offs[0].start, offs[0].end. Under old-style non-COW, it uses offs[0].start and end to determine what subset to the buffer to capture. So set them first!
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 5189aec634..4d317cfd0b 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2310,15 +2310,15 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
* Let @-, @+, $^N know */
prog->lastparen = prog->lastcloseparen = 0;
RX_MATCH_UTF8_set(rx, utf8_target);
+ prog->offs[0].start = s - strbeg;
+ prog->offs[0].end = utf8_target
+ ? (char*)utf8_hop((U8*)s, prog->minlenret) - strbeg
+ : s - strbeg + prog->minlenret;
if ( !(flags & REXEC_NOT_FIRST) )
S_reg_set_capture_string(aTHX_ rx,
strbeg, strend,
sv, flags, utf8_target);
- prog->offs[0].start = s - strbeg;
- prog->offs[0].end = utf8_target
- ? (char*)utf8_hop((U8*)s, prog->minlenret) - strbeg
- : s - strbeg + prog->minlenret;
return 1;
}
}