diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-10-01 09:08:18 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-10-01 12:51:58 -0700 |
commit | 667f6f1513bb7f13b7b6bb7c1acaeed6f8f9c6dd (patch) | |
tree | 8afb9260c5826e09e95d72dce440d04a48d67f71 /sv.c | |
parent | 6715405f56348468cfa2fd83507da0171e7aed58 (diff) | |
download | perl-667f6f1513bb7f13b7b6bb7c1acaeed6f8f9c6dd.tar.gz |
Make sprintf "%1s" and "%.1s" call overloading once
Calling overloading multiple times can probably result in mangled
UTF8, but it is much easier just to test for the number of calls.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -10532,16 +10532,17 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p if (DO_UTF8(argsv)) { STRLEN old_precis = precis; if (has_precis && precis < elen) { - STRLEN ulen = sv_len_utf8_nomg(argsv); + STRLEN ulen = sv_or_pv_len_utf8(argsv, eptr, elen); STRLEN p = precis > ulen ? ulen : precis; - precis = sv_pos_u2b_flags(argsv, p, 0, 0); + precis = sv_or_pv_pos_u2b(argsv, eptr, p, 0); /* sticks at end */ } if (width) { /* fudge width (can't fudge elen) */ if (has_precis && precis < elen) width += precis - old_precis; else - width += elen - sv_len_utf8_nomg(argsv); + width += + elen - sv_or_pv_len_utf8(argsv,eptr,elen); } is_utf8 = TRUE; } |