This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handy.h Fix isOCTAL_A macro
authorKarl Williamson <public@khwilliamson.com>
Sat, 1 Oct 2011 18:59:34 +0000 (12:59 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sat, 1 Oct 2011 19:18:52 +0000 (13:18 -0600)
This has the incorrect definition, allowing 8 and 9, for programs that
don't include perl.h.  Likely no one actually uses this recently added
macro who doesn't also include perl.h.

handy.h

diff --git a/handy.h b/handy.h
index e8c9b12..0a03067 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -658,7 +658,7 @@ EXTCONST U32 PL_charclass[];
      * multi-char fold */
 #   define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) ((! cBOOL(FITS_IN_8_BITS(c))) || (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_NONLATIN1_FOLD))
 #else   /* No perl.h. */
      * multi-char fold */
 #   define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) ((! cBOOL(FITS_IN_8_BITS(c))) || (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_NONLATIN1_FOLD))
 #else   /* No perl.h. */
-#   define isOCTAL_A(c)  ((c) >= '0' && (c) <= '9')
+#   define isOCTAL_A(c)  ((c) >= '0' && ((c) <= '7')
 #   ifdef EBCDIC
 #       define isALNUMC_A(c)   (isASCII(c) && isALNUMC(c))
 #       define isALPHA_A(c)    (isASCII(c) && isALPHA(c))
 #   ifdef EBCDIC
 #       define isALNUMC_A(c)   (isASCII(c) && isALNUMC(c))
 #       define isALPHA_A(c)    (isASCII(c) && isALPHA(c))