summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-29 23:56:56 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-10-01 12:51:57 -0700
commit0d788f38463b7bfebf74c59cb7d648fc3e83f204 (patch)
treee27cd181da2b7df43a8ec14f521fa972fe66c7c5 /pp.c
parent7c1f5fb6d5d76ca76a743274330a7d906bb82a6b (diff)
downloadperl-0d788f38463b7bfebf74c59cb7d648fc3e83f204.tar.gz
Make rvalue substr call overloading once on utf8 str
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index e91db87adf..24837a0897 100644
--- a/pp.c
+++ b/pp.c
@@ -3075,7 +3075,7 @@ PP(pp_substr)
}
else tmps = SvPV_const(sv, curlen);
if (DO_UTF8(sv)) {
- utf8_curlen = sv_len_utf8_nomg(sv);
+ utf8_curlen = sv_or_pv_len_utf8(sv, tmps, curlen);
if (utf8_curlen == curlen)
utf8_curlen = 0;
else
@@ -3093,7 +3093,7 @@ PP(pp_substr)
byte_len = len;
byte_pos = utf8_curlen
- ? sv_pos_u2b_flags(sv, pos, &byte_len, SV_CONST_RETURN) : pos;
+ ? sv_or_pv_pos_u2b(sv, tmps, pos, &byte_len) : pos;
tmps += byte_pos;