diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-11-09 11:21:10 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-11-09 11:21:10 +0000 |
commit | 6b58708ba0b8d2e44d1ba2d0c16da2fae0767752 (patch) | |
tree | 0609f684f4a1aa75f8ebc258ae03e63c8706616b /op.c | |
parent | 6d6403992dc19fd3b831cbc6a211e3354a53c639 (diff) | |
download | perl-6b58708ba0b8d2e44d1ba2d0c16da2fae0767752.tar.gz |
Simplify Perl_allocmy slightly, and cope better with the name is ""
case.
p4raw-id: //depot/perl@26061
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -211,11 +211,13 @@ Perl_allocmy(pTHX_ char *name) PADOFFSET off; /* complain about "my $<special_var>" etc etc */ - if (!(PL_in_my == KEY_our || + if (*name && + !(PL_in_my == KEY_our || isALPHA(name[1]) || (USE_UTF8_IN_NAMES && UTF8_IS_START(name[1])) || - (name[1] == '_' && (*name == '$' || (int)strlen(name) > 2)))) + (name[1] == '_' && (*name == '$' || name[2])))) { + /* name[2] is true if strlen(name) > 2 */ if (!isPRINT(name[1]) || strchr("\t\n\r\f", name[1])) { /* 1999-02-27 mjd@plover.com */ char *p; |