diff options
author | Yves Orton <demerphq@gmail.com> | 2009-09-10 19:28:20 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2009-09-10 19:28:20 +0200 |
commit | 2c2969659ae1c534e7f3fac9e7a7d186defd9943 (patch) | |
tree | 3ea479f5ab0da5eddba3922e1357279f21e41e7c /pp_ctl.c | |
parent | 831a7dd792d2967a0cfe83bb0272cf0a346df76d (diff) | |
download | perl-2c2969659ae1c534e7f3fac9e7a7d186defd9943.tar.gz |
add more positive gofs GPOS tests and fix some bugs too
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -233,13 +233,16 @@ PP(pp_substcont) if (!(cx->sb_rxtainted & 2) && SvTAINTED(TOPs)) cx->sb_rxtainted |= 2; sv_catsv(dstr, POPs); + /* XXX: adjust for positive offsets of \G for instance s/(.)\G//g with positive pos() */ + s -= RX_GOFS(rx); /* Are we done */ - if (CxONCE(cx) || !CALLREGEXEC(rx, s, cx->sb_strend, orig, - s == m, cx->sb_targ, NULL, - ((cx->sb_rflags & REXEC_COPY_STR) - ? (REXEC_IGNOREPOS|REXEC_NOT_FIRST) - : (REXEC_COPY_STR|REXEC_IGNOREPOS|REXEC_NOT_FIRST)))) + if (CxONCE(cx) || s < orig || + !CALLREGEXEC(rx, s, cx->sb_strend, orig, + (s == m) + RX_GOFS(rx), cx->sb_targ, NULL, + ((cx->sb_rflags & REXEC_COPY_STR) + ? (REXEC_IGNOREPOS|REXEC_NOT_FIRST) + : (REXEC_COPY_STR|REXEC_IGNOREPOS|REXEC_NOT_FIRST)))) { SV * const targ = cx->sb_targ; |