summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-10-26 10:48:48 -0600
committerKarl Williamson <public@khwilliamson.com>2012-11-11 10:11:33 -0700
commit225fb84f3eb1da83cbc8c79add24882deac79906 (patch)
treea3c99ea2dc93ff68715185c0577cd5c07a539042 /toke.c
parent699ffc5e6f6d1426d23e60b98f7935ec76291935 (diff)
downloadperl-225fb84f3eb1da83cbc8c79add24882deac79906.tar.gz
charnames: Don't accept illegal :aliases
Now that improper names for characters are an error, we can forbid them at definition time. For the time being allow a colon in the check that continues to be run in toke.c. This will be removed in a future commit.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index b3c37670d5..7cb00700ae 100644
--- a/toke.c
+++ b/toke.c
@@ -2663,7 +2663,8 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e)
return NULL;
}
- {
+ { /* This code needs to be sync'ed with a regex in _charnames.pm which
+ does the same thing */
bool problematic = FALSE;
const char* i = s;
@@ -2672,7 +2673,7 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e)
if (! UTF) {
if (! isALPHAU(*i)) problematic = TRUE;
else for (i = s + 1; i < e; i++) {
- if (isCHARNAME_CONT(*i)) continue;
+ if (isCHARNAME_CONT(*i) || *i == ':') continue;
problematic = TRUE;
break;
}
@@ -2697,7 +2698,7 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e)
i+= UTF8SKIP(i))
{
if (UTF8_IS_INVARIANT(*i)) {
- if (isCHARNAME_CONT(*i)) continue;
+ if (isCHARNAME_CONT(*i) || *i == ':') continue;
} else if (! UTF8_IS_DOWNGRADEABLE_START(*i)) {
continue;
} else if (isCHARNAME_CONT(