summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-11-09 20:34:11 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-11-09 20:34:11 +0000
commiteeb3addf3feec5ffbcc249451fd5751440056e0d (patch)
treef768dac0b163ce44ec17e0d6bb12b2aa8f8c72dd /pp_ctl.c
parent4a4a611618e8ff6d5ad41c0e944ec39ce1bd0e52 (diff)
parentc024d977a3f66deece6fa8197092e1716641d48e (diff)
downloadperl-eeb3addf3feec5ffbcc249451fd5751440056e0d.tar.gz
Integrate mainline.
p4raw-id: //depot/perlio@7630
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 729a438f32..fce163fc3e 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -211,6 +211,21 @@ PP(pp_substcont)
cx->sb_m = m = rx->startp[0] + orig;
sv_catpvn(dstr, s, m-s);
cx->sb_s = rx->endp[0] + orig;
+ { /* Update the pos() information. */
+ SV *sv = cx->sb_targ;
+ MAGIC *mg;
+ I32 i;
+ if (SvTYPE(sv) < SVt_PVMG)
+ SvUPGRADE(sv, SVt_PVMG);
+ if (!(mg = mg_find(sv, 'g'))) {
+ sv_magic(sv, Nullsv, 'g', Nullch, 0);
+ mg = mg_find(sv, 'g');
+ }
+ i = m - orig;
+ if (DO_UTF8(sv))
+ sv_pos_b2u(sv, &i);
+ mg->mg_len = i;
+ }
cx->sb_rxtainted |= RX_MATCH_TAINTED(rx);
rxres_save(&cx->sb_rxres, rx);
RETURNOP(pm->op_pmreplstart);