summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-04-10 17:26:43 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-04-10 17:26:43 +0000
commit94dd854965f7320316afa0b2c765c34c7d877888 (patch)
tree0714e8df5fe512a1e22d6e46691ff55a00daa604 /numeric.c
parent568558b743cc8ac5b79d4b2150447feb84fbe4db (diff)
downloadperl-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index b472155444..14f593af71 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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);
}