summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-08-06 20:59:16 +0100
committerFather Chrysostomos <sprout@cpan.org>2012-03-22 20:23:56 -0700
commitd0fb66e4dd07da2a32d4da479eecdd70515e9f20 (patch)
tree6f1ed59a81108b86cc677da07462e7c39cfd2aa3
parent29fb1d0ef33facc7d4fe58f19322d7d81ade25a8 (diff)
downloadperl-d0fb66e4dd07da2a32d4da479eecdd70515e9f20.tar.gz
toke.c: S_checkcomma, "No comma allowed after %s" cleanup
-rw-r--r--t/uni/parser.t8
-rw-r--r--toke.c5
2 files changed, 10 insertions, 3 deletions
diff --git a/t/uni/parser.t b/t/uni/parser.t
index e67871e944..256864cb80 100644
--- a/t/uni/parser.t
+++ b/t/uni/parser.t
@@ -7,7 +7,7 @@ BEGIN {
require './test.pl';
}
-plan (tests => 44);
+plan (tests => 45);
use utf8;
use open qw( :utf8 :std );
@@ -132,3 +132,9 @@ is ${"main::\345\225\217"}, undef, "..and using the encoded form doesn't";
like $@, qr!"$_" variable \$::\x{30cb} can't be in a package!, qq!'"$_" variable %s can't be in a package' is UTF-8 clean!;
}
}
+
+{
+ local $@;
+ eval qq!print \x{30cb}, "comma""!;
+ like $@, qr/No comma allowed after filehandle/, "No comma allowed after filehandle triggers correctly for UTF-8 filehandles.";
+}
diff --git a/toke.c b/toke.c
index 1696e24203..0e6bc4de73 100644
--- a/toke.c
+++ b/toke.c
@@ -8623,9 +8623,10 @@ S_checkcomma(pTHX_ const char *s, const char *name, const char *what)
while (s < PL_bufend && isSPACE(*s))
s++;
if (isIDFIRST_lazy_if(s,UTF)) {
- const char * const w = s++;
+ const char * const w = s;
+ s += UTF ? UTF8SKIP(s) : 1;
while (isALNUM_lazy_if(s,UTF))
- s++;
+ s += UTF ? UTF8SKIP(s) : 1;
while (s < PL_bufend && isSPACE(*s))
s++;
if (*s == ',') {