diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-10 17:26:43 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-10 17:26:43 +0000 |
commit | 94dd854965f7320316afa0b2c765c34c7d877888 (patch) | |
tree | 0714e8df5fe512a1e22d6e46691ff55a00daa604 /numeric.c | |
parent | 568558b743cc8ac5b79d4b2150447feb84fbe4db (diff) | |
download | perl-94dd854965f7320316afa0b2c765c34c7d877888.tar.gz |
Add an option for the grok_xxx() to silently ignore bad digits.
p4raw-id: //depot/perl@19184
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -197,7 +197,7 @@ Perl_grok_bin(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) { ++s; goto redo; } - if (ckWARN(WARN_DIGIT)) + if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT) && ckWARN(WARN_DIGIT)) Perl_warner(aTHX_ packWARN(WARN_DIGIT), "Illegal binary digit '%c' ignored", *s); break; @@ -312,7 +312,7 @@ Perl_grok_hex(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) { ++s; goto redo; } - if (ckWARN(WARN_DIGIT)) + if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT) && ckWARN(WARN_DIGIT)) Perl_warner(aTHX_ packWARN(WARN_DIGIT), "Illegal hexadecimal digit '%c' ignored", *s); break; @@ -398,7 +398,7 @@ Perl_grok_oct(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) { * as soon as non-octal characters are seen, complain only iff * someone seems to want to use the digits eight and nine). */ if (digit == 8 || digit == 9) { - if (ckWARN(WARN_DIGIT)) + if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT) && ckWARN(WARN_DIGIT)) Perl_warner(aTHX_ packWARN(WARN_DIGIT), "Illegal octal digit '%c' ignored", *s); } |