Move parent from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 0eb513f..e69bf0c 100644 (file)
--- 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;
 
@@ -3354,7 +3357,7 @@ PP(pp_require)
                    /* Adjust file name if the hook has set an %INC entry */
                    svp = hv_fetch(GvHVn(PL_incgv), name, len, 0);
                    if (svp)
-                       tryname = SvPVX_const(*svp);
+                       tryname = SvPV_nolen_const(*svp);
 
                    if (count > 0) {
                        int i = 0;