This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Remove redundant test
authorKarl Williamson <public@khwilliamson.com>
Mon, 22 Apr 2013 20:34:47 +0000 (14:34 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 20 May 2013 14:59:14 +0000 (08:59 -0600)
This checks that something is both not-printable and not a word
character, but all word characters are printable, so just the
non-printable test suffices.

toke.c

diff --git a/toke.c b/toke.c
index f49e2d6..ff6308f 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -9370,7 +9370,7 @@ S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck
        }
        /* Handle extended ${^Foo} variables
         * 1999-02-27 mjd-perl-patch@plover.com */
-       else if (!isWORDCHAR(*d) && !isPRINT(*d) /* isCTRL(d) */
+       else if (! isPRINT(*d) /* isCNTRL(d), plus all non-ASCII */
                 && isWORDCHAR(*s))
        {
            d++;