diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-09-27 14:25:53 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-09-27 14:25:53 +0000 |
commit | 013b78e8b7544d87392bc0a7f2840e8f7280e786 (patch) | |
tree | 118ce00b281bf0c1962ea6f558911cee58866692 /mg.c | |
parent | 93c2c2ecd9924225ba4c26762e3e59cf95458982 (diff) | |
download | perl-013b78e8b7544d87392bc0a7f2840e8f7280e786.tar.gz |
Fix by Rick Delaney for [perl #3269] no warnings "bareword" turns off
too many warnings.
p4raw-id: //depot/perl@25619
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -785,11 +785,16 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) if (*(mg->mg_ptr+1) == '\0') sv_setiv(sv, (IV)((PL_dowarn & G_WARN_ON) ? TRUE : FALSE)); else if (strEQ(mg->mg_ptr+1, "ARNING_BITS")) { - if (PL_compiling.cop_warnings == pWARN_NONE || - PL_compiling.cop_warnings == pWARN_STD) - { + if (PL_compiling.cop_warnings == pWARN_NONE) { sv_setpvn(sv, WARN_NONEstring, WARNsize) ; - } + } + else if (PL_compiling.cop_warnings == pWARN_STD) { + sv_setpvn( + sv, + (PL_dowarn & G_WARN_ON) ? WARN_ALLstring : WARN_NONEstring, + WARNsize + ); + } else if (PL_compiling.cop_warnings == pWARN_ALL) { /* Get the bit mask for $warnings::Bits{all}, because * it could have been extended by warnings::register */ |