From bf32a30c1f803670e172ece4c2d134a707a94f6c Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Mon, 26 Sep 2011 17:24:44 -0700 Subject: 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. --- pp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pp.c') 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, ""); -- cgit v1.2.1