This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec_flags(): simplify length calculation
[perl5.git] / regexec.c
index 9db9577..df815b2 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -2568,7 +2568,7 @@ got_it:
     if ( !(flags & REXEC_NOT_FIRST) ) {
        RX_MATCH_COPY_FREE(rx);
        if (flags & REXEC_COPY_STR) {
-           const I32 i = PL_regeol - startpos + (stringarg - strbeg);
+           const I32 i = PL_regeol - strbeg;
 #ifdef PERL_OLD_COPY_ON_WRITE
            if ((SvIsCOW(sv)
                 || (SvFLAGS(sv) & CAN_COW_MASK) == CAN_COW_FLAGS)) {