diff options
-rw-r--r-- | numeric.c | 8 | ||||
-rw-r--r-- | pp.c | 4 | ||||
-rw-r--r-- | toke.c | 4 |
3 files changed, 8 insertions, 8 deletions
@@ -153,11 +153,11 @@ Perl_grok_bin(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) for compatibility silently suffer "b" and "0b" as valid binary numbers. */ if (len >= 1) { - if (s[0] == 'b') { + if (s[0] == 'b' || s[0] == 'B') { s++; len--; } - else if (len >= 2 && s[0] == '0' && s[1] == 'b') { + else if (len >= 2 && s[0] == '0' && (s[1] == 'b' || s[1] == 'B')) { s+=2; len-=2; } @@ -269,11 +269,11 @@ Perl_grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) for compatibility silently suffer "x" and "0x" as valid hex numbers. */ if (len >= 1) { - if (s[0] == 'x') { + if (s[0] == 'x' || s[0] == 'X') { s++; len--; } - else if (len >= 2 && s[0] == '0' && s[1] == 'x') { + else if (len >= 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) { s+=2; len-=2; } @@ -3067,11 +3067,11 @@ PP(pp_oct) tmps++, len--; if (*tmps == '0') tmps++, len--; - if (*tmps == 'x') { + if (*tmps == 'x' || *tmps == 'X') { hex: result_uv = grok_hex (tmps, &len, &flags, &result_nv); } - else if (*tmps == 'b') + else if (*tmps == 'b' || *tmps == 'B') result_uv = grok_bin (tmps, &len, &flags, &result_nv); else result_uv = grok_oct (tmps, &len, &flags, &result_nv); @@ -12978,11 +12978,11 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) const char *base, *Base, *max; /* check for hex */ - if (s[1] == 'x') { + if (s[1] == 'x' || s[1] == 'X') { shift = 4; s += 2; just_zero = FALSE; - } else if (s[1] == 'b') { + } else if (s[1] == 'b' || s[1] == 'B') { shift = 1; s += 2; just_zero = FALSE; |