diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-10-26 10:48:48 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-11-11 10:11:33 -0700 |
commit | 225fb84f3eb1da83cbc8c79add24882deac79906 (patch) | |
tree | a3c99ea2dc93ff68715185c0577cd5c07a539042 /toke.c | |
parent | 699ffc5e6f6d1426d23e60b98f7935ec76291935 (diff) | |
download | perl-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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( |