This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: VALID_LEN_ONE_IDENT only needs a char, not a char*
authorBrian Fraser <fraserbn@gmail.com>
Sat, 9 Mar 2013 19:20:00 +0000 (16:20 -0300)
committerKarl Williamson <public@khwilliamson.com>
Mon, 20 May 2013 14:59:11 +0000 (08:59 -0600)
Rather than passing s and having the macro do a bunch of *s,
just pass and expect *s.

toke.c

diff --git a/toke.c b/toke.c
index fc3f188..f49e2d6 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -9320,12 +9320,12 @@ S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck
           s++;
     }
 
-#define VALID_LEN_ONE_IDENT(d, u)     (isPUNCT_A((U8)*(d))     \
-                                        || isCNTRL_A((U8)*(d)) \
-                                        || isDIGIT_A((U8)*(d)) \
-                                        || (!(u) && !UTF8_IS_INVARIANT((U8)*(d))))
+#define VALID_LEN_ONE_IDENT(d, u)     (isPUNCT_A((U8)(d))     \
+                                        || isCNTRL_A((U8)(d)) \
+                                        || isDIGIT_A((U8)(d)) \
+                                        || (!(u) && !UTF8_IS_INVARIANT((U8)(d))))
     if (s < send
-        && (isIDFIRST_lazy_if(s, is_utf8) || VALID_LEN_ONE_IDENT(s, is_utf8)))
+        && (isIDFIRST_lazy_if(s, is_utf8) || VALID_LEN_ONE_IDENT(*s, is_utf8)))
     {
         if (is_utf8) {
             const STRLEN skip = UTF8SKIP(s);