This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Localizing some vars in S_checkcomma
authorAndy Lester <andy@petdance.com>
Fri, 10 Mar 2006 16:31:00 +0000 (10:31 -0600)
committerNicholas Clark <nick@ccl4.org>
Sat, 11 Mar 2006 09:55:43 +0000 (09:55 +0000)
Message-ID: <20060310223100.GA13455@petdance.com>
Date: Fri, 10 Mar 2006 16:31:00 -0600

p4raw-id: //depot/perl@27469

toke.c

diff --git a/toke.c b/toke.c
index 3a3afe5..f16964e 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -10156,19 +10156,19 @@ STATIC void
 S_checkcomma(pTHX_ const char *s, const char *name, const char *what)
 {
     dVAR;
-    const char *w;
 
     if (*s == ' ' && s[1] == '(') {    /* XXX gotta be a better way */
        if (ckWARN(WARN_SYNTAX)) {
            int level = 1;
+           const char *w;
            for (w = s+2; *w && level; w++) {
                if (*w == '(')
                    ++level;
                else if (*w == ')')
                    --level;
            }
-           if (*w)
-               for (; *w && isSPACE(*w); w++) ;
+           for (; *w && isSPACE(*w); w++)
+               /* EMPTY */;
            if (!*w || !strchr(";|})]oaiuw!=", *w))     /* an advisory hack only... */
                Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                            "%s (...) interpreted as function",name);
@@ -10181,7 +10181,7 @@ S_checkcomma(pTHX_ const char *s, const char *name, const char *what)
     while (s < PL_bufend && isSPACE(*s))
        s++;
     if (isIDFIRST_lazy_if(s,UTF)) {
-       w = s++;
+       const char * const w = s++;
        while (isALNUM_lazy_if(s,UTF))
            s++;
        while (s < PL_bufend && isSPACE(*s))