summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorClaes Jacobsson <claes@surfar.nu>2007-08-04 18:00:19 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-08-10 09:57:08 +0000
commit356c7adf53ddf6b2b7f62f53bc2d999b974db873 (patch)
tree8291f83de514bc9a616de16f146f77031db9ab0f /toke.c
parent1630c0b5f1128c49069f0f5e02a02f852c090e0b (diff)
downloadperl-356c7adf53ddf6b2b7f62f53bc2d999b974db873.tar.gz
Re: [PATCH] Adding more information to "Unrecognized character" error in toke.c
Message-Id: <57CEC660-0020-48DF-A72A-931BCADC2AEE@surfar.nu> p4raw-id: //depot/perl@31699
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index ead6806bf0..889e7ec81b 100644
--- a/toke.c
+++ b/toke.c
@@ -3561,7 +3561,8 @@ Perl_yylex(pTHX)
default:
if (isIDFIRST_lazy_if(s,UTF))
goto keylookup;
- Perl_croak(aTHX_ "Unrecognized character \\x%02X", *s & 255);
+ len = UTF ? Perl_utf8_length((U8 *) PL_linestart, (U8 *) s) : (STRLEN) (s - PL_linestart);
+ Perl_croak(aTHX_ "Unrecognized character \\x%02X in column %d", *s & 255, (int) len + 1);
case 4:
case 26:
goto fake_eof; /* emulate EOF on ^D or ^Z */