diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-26 17:24:44 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:09 -0700 |
commit | bf32a30c1f803670e172ece4c2d134a707a94f6c (patch) | |
tree | a251f4869b99446c6037ddb3d21a2b357f698b14 /pp.c | |
parent | d527ce7c3632e2eaebee9f962268da87e0becd51 (diff) | |
download | perl-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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, ""); |