summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2009-09-10 19:28:20 +0200
committerYves Orton <demerphq@gmail.com>2009-09-10 19:28:20 +0200
commit2c2969659ae1c534e7f3fac9e7a7d186defd9943 (patch)
tree3ea479f5ab0da5eddba3922e1357279f21e41e7c /pp_ctl.c
parent831a7dd792d2967a0cfe83bb0272cf0a346df76d (diff)
downloadperl-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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 4cde9f8854..e69bf0c880 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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;