summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-27 14:25:53 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-27 14:25:53 +0000
commit013b78e8b7544d87392bc0a7f2840e8f7280e786 (patch)
tree118ce00b281bf0c1962ea6f558911cee58866692 /mg.c
parent93c2c2ecd9924225ba4c26762e3e59cf95458982 (diff)
downloadperl-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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index d3a001af4c..46b2d75000 100644
--- a/mg.c
+++ b/mg.c
@@ -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 */