| 1 |
diff -up perl-5.10.0/t/op/subst.t.pos perl-5.10.0/t/op/subst.t
|
| 2 |
--- perl-5.10.0/t/op/subst.t.pos 2007-12-18 11:47:08.000000000 +0100
|
| 3 |
+++ perl-5.10.0/t/op/subst.t 2008-07-21 11:01:01.000000000 +0200
|
| 4 |
@@ -7,7 +7,7 @@ BEGIN {
|
| 5 |
}
|
| 6 |
|
| 7 |
require './test.pl';
|
| 8 |
-plan( tests => 136 );
|
| 9 |
+plan( tests => 139 );
|
| 10 |
|
| 11 |
$x = 'foo';
|
| 12 |
$_ = "x";
|
| 13 |
@@ -583,3 +583,11 @@ is($name, "cis", q[#22351 bug with 'e' s
|
| 14 |
is($want,$_,"RT#17542");
|
| 15 |
}
|
| 16 |
|
| 17 |
+{
|
| 18 |
+ my @tests = ('ABC', "\xA3\xA4\xA5", "\x{410}\x{411}\x{412}");
|
| 19 |
+ foreach (@tests) {
|
| 20 |
+ my $id = ord $_;
|
| 21 |
+ s/./pos/ge;
|
| 22 |
+ is($_, "012", "RT#52104: $id");
|
| 23 |
+ }
|
| 24 |
+}
|
| 25 |
diff -up perl-5.10.0/pp_ctl.c.pos perl-5.10.0/pp_ctl.c
|
| 26 |
--- perl-5.10.0/pp_ctl.c.pos 2007-12-18 11:47:08.000000000 +0100
|
| 27 |
+++ perl-5.10.0/pp_ctl.c 2008-07-21 12:31:50.000000000 +0200
|
| 28 |
@@ -285,7 +285,6 @@ PP(pp_substcont)
|
| 29 |
{ /* Update the pos() information. */
|
| 30 |
SV * const sv = cx->sb_targ;
|
| 31 |
MAGIC *mg;
|
| 32 |
- I32 i;
|
| 33 |
SvUPGRADE(sv, SVt_PVMG);
|
| 34 |
if (!(mg = mg_find(sv, PERL_MAGIC_regex_global))) {
|
| 35 |
#ifdef PERL_OLD_COPY_ON_WRITE
|
| 36 |
@@ -295,10 +294,7 @@ PP(pp_substcont)
|
| 37 |
mg = sv_magicext(sv, NULL, PERL_MAGIC_regex_global, &PL_vtbl_mglob,
|
| 38 |
NULL, 0);
|
| 39 |
}
|
| 40 |
- i = m - orig;
|
| 41 |
- if (DO_UTF8(sv))
|
| 42 |
- sv_pos_b2u(sv, &i);
|
| 43 |
- mg->mg_len = i;
|
| 44 |
+ mg->mg_len = m - orig;
|
| 45 |
}
|
| 46 |
if (old != rx)
|
| 47 |
(void)ReREFCNT_inc(rx);
|