summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-08-29 13:57:26 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-29 13:57:26 +0000
commitf4fc778265a1b896cf1e2a3fa667837b80dedfd5 (patch)
tree3fa3f62c7f5465de7f9045bf63ca73be32a31f55 /mg.c
parente4d2c5c6fbbe8a25c7af20973977e501d751cef6 (diff)
downloadperl-f4fc778265a1b896cf1e2a3fa667837b80dedfd5.tar.gz
Missed a change in #6869.
p4raw-id: //depot/perl@6879
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mg.c b/mg.c
index d4e1a043d9..088ae0b742 100644
--- a/mg.c
+++ b/mg.c
@@ -1747,18 +1747,21 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
PL_compiling.cop_warnings = pWARN_NONE;
break;
}
- if (isWARN_on(sv, WARN_ALL) && !isWARNf_on(sv, WARN_ALL)) {
- PL_compiling.cop_warnings = pWARN_ALL;
- PL_dowarn |= G_WARN_ONCE ;
- }
- else {
+ {
STRLEN len, i;
int accumulate = 0 ;
+ int any_fatals = 0 ;
char * ptr = (char*)SvPV(sv, len) ;
- for (i = 0 ; i < len ; ++i)
- accumulate += ptr[i] ;
+ for (i = 0 ; i < len ; ++i) {
+ accumulate |= ptr[i] ;
+ any_fatals |= (ptr[i] & 0xAA) ;
+ }
if (!accumulate)
PL_compiling.cop_warnings = pWARN_NONE;
+ else if (isWARN_on(sv, WARN_ALL) && !any_fatals) {
+ PL_compiling.cop_warnings = pWARN_ALL;
+ PL_dowarn |= G_WARN_ONCE ;
+ }
else {
if (specialWARN(PL_compiling.cop_warnings))
PL_compiling.cop_warnings = newSVsv(sv) ;
@@ -1767,6 +1770,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
if (isWARN_on(PL_compiling.cop_warnings, WARN_ONCE))
PL_dowarn |= G_WARN_ONCE ;
}
+
}
}
}