From 4c01a014641ade309fdf32a66b1e9939f10566ac Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Sat, 6 Aug 2011 08:05:16 +0100 Subject: toke.c: 'You need to quote %s' cleanup. --- t/lib/warnings/toke | 20 ++++++++++++++++++++ toke.c | 8 +++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index 4c6c8fe6a2..2214005260 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -237,6 +237,26 @@ EXPECT You need to quote "fred" at - line 3. ######## # toke.c +use utf8; +use open qw( :utf8 :std ); +use warnings 'syntax' ; +sub frèd {} ; $SIG{TERM} = frèd; +no warnings 'syntax' ; +$SIG{TERM} = frèd; +EXPECT +You need to quote "frèd" at - line 5. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +use warnings 'syntax' ; +sub ふれど {} ; $SIG{TERM} = ふれど; +no warnings 'syntax' ; +$SIG{TERM} = ふれど; +EXPECT +You need to quote "ふれど" at - line 5. +######## +# toke.c use warnings 'syntax' ; @a[3] = 2; @a{3} = 2; diff --git a/toke.c b/toke.c index c0a5cdaf09..426eb2ca23 100644 --- a/toke.c +++ b/toke.c @@ -6184,10 +6184,12 @@ Perl_yylex(pTHX) &len); while (isSPACE(*t)) t++; - if (*t == ';' && get_cvn_flags(tmpbuf, len, 0)) + if (*t == ';' + && get_cvn_flags(tmpbuf, len, UTF ? SVf_UTF8 : 0)) Perl_warner(aTHX_ packWARN(WARN_SYNTAX), - "You need to quote \"%s\"", - tmpbuf); + "You need to quote \"%"SVf"\"", + SVfARG(newSVpvn_flags(tmpbuf, len, + SVs_TEMP | (UTF ? SVf_UTF8 : 0)))); } } } -- cgit v1.2.1