In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d7cf15ed3621c923ff3ce120367eec0f05078d4b?hp=d3bcd21f9c56ad29603330017e1fef6e7910189b>
- Log ----------------------------------------------------------------- commit d7cf15ed3621c923ff3ce120367eec0f05078d4b Author: Rafael Garcia-Suarez <[email protected]> Date: Wed Jan 25 12:45:25 2012 +0100 Correctly escape UTF-8 in hash keys in uninitialized warnings ----------------------------------------------------------------------- Summary of changes: sv.c | 3 ++- t/lib/warnings/9uninit | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sv.c b/sv.c index 2dce137..be5aec8 100644 --- a/sv.c +++ b/sv.c @@ -13895,7 +13895,8 @@ Perl_varname(pTHX_ const GV *const gv, const char gvtype, PADOFFSET targ, SV * const sv = newSV(0); *SvPVX(name) = '$'; Perl_sv_catpvf(aTHX_ name, "{%s}", - pv_display(sv,SvPVX_const(keyname), SvCUR(keyname), 0, 32)); + pv_pretty(sv, SvPVX_const(keyname), SvCUR(keyname), 32, NULL, NULL, + PERL_PV_PRETTY_DUMP | PERL_PV_ESCAPE_UNI_DETECT )); SvREFCNT_dec(sv); } else if (subscript_type == FUV_SUBSCRIPT_ARRAY) { diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index 0d2d841..37e24e7 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -1189,10 +1189,10 @@ use warnings 'uninitialized'; my ($v); # check hash key is sanitised -my %h = ("\0011\002\r\n\t\f\"\\abcdefghijklmnopqrstuvwxyz", undef); +my %h = ("\0011\002\r\n\t\f\"\\\x{1234}abcdefghijklmnopqrstuvwxyz", undef); $v = join '', %h; EXPECT -Use of uninitialized value $h{"\0011\2\r\n\t\f\"\\abcdefghijklm"...} in join or string at - line 6. +Use of uninitialized value $h{"\0011\2\r\n\t\f\"\\\x{1234}abcde"...} in join or string at - line 6. ######## use warnings 'uninitialized'; my ($m1, $v); -- Perl5 Master Repository
