summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-26 17:24:44 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:09 -0700
commitbf32a30c1f803670e172ece4c2d134a707a94f6c (patch)
treea251f4869b99446c6037ddb3d21a2b357f698b14 /pp.c
parentd527ce7c3632e2eaebee9f962268da87e0becd51 (diff)
downloadperl-bf32a30c1f803670e172ece4c2d134a707a94f6c.tar.gz
pp.c: pp_substr for UTF-8 globs.
Since typeglobs may have the UTF8 flag set now, we need to avoid testing SvCUR on a potential glob, as that would trip an assertion.
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 9250751644..a102a213ef 100644
--- a/pp.c
+++ b/pp.c
@@ -2978,7 +2978,7 @@ PP(pp_substr)
if (num_args > 3) {
if((repl_sv = POPs)) {
repl = SvPV_const(repl_sv, repl_len);
- repl_is_utf8 = DO_UTF8(repl_sv) && SvCUR(repl_sv);
+ repl_is_utf8 = DO_UTF8(repl_sv) && repl_len;
}
else num_args--;
}
@@ -3112,7 +3112,7 @@ PP(pp_substr)
repl_sv_copy = newSVsv(repl_sv);
sv_utf8_upgrade(repl_sv_copy);
repl = SvPV_const(repl_sv_copy, repl_len);
- repl_is_utf8 = DO_UTF8(repl_sv_copy) && SvCUR(sv);
+ repl_is_utf8 = DO_UTF8(repl_sv_copy) && repl_len;
}
if (!SvOK(sv))
sv_setpvs(sv, "");