From: Nicholas Clark Date: Wed, 9 Nov 2005 11:21:10 +0000 (+0000) Subject: Simplify Perl_allocmy slightly, and cope better with the name is "" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6b58708ba0b8d2e44d1ba2d0c16da2fae0767752;p=p5sagit%2Fp5-mst-13.2.git Simplify Perl_allocmy slightly, and cope better with the name is "" case. p4raw-id: //depot/perl@26061 --- diff --git a/op.c b/op.c index 2ca186c..03ca56e 100644 --- a/op.c +++ b/op.c @@ -211,11 +211,13 @@ Perl_allocmy(pTHX_ char *name) PADOFFSET off; /* complain about "my $" 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;