summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index 4f9fdac6a4..37671b1b29 100644
--- a/perl.c
+++ b/perl.c
@@ -2061,7 +2061,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
}
#endif
- if (PL_taint_warn && PL_dowarn != G_WARN_ALL_OFF) {
+ if (PL_taint_warn && !(PL_dowarn & (G_WARN_ALL_OFF | G_WARN_ALL_ON | G_WARN_ON))) {
PL_compiling.cop_warnings
= Perl_new_warnings_bitfield(aTHX_ NULL, WARN_TAINTstring, WARNsize);
}
@@ -3376,8 +3376,14 @@ this system using \"man perl\" or \"perldoc perl\". If you have access to the\n
Internet, point your browser at http://www.perl.org/, the Perl Home Page.\n\n");
my_exit(0);
case 'w':
- if (! (PL_dowarn & G_WARN_ALL_MASK))
+ if (! (PL_dowarn & G_WARN_ALL_MASK)) {
PL_dowarn |= G_WARN_ON;
+ if (PL_taint_warn) {
+ if (!specialWARN(PL_compiling.cop_warnings))
+ PerlMemShared_free(PL_compiling.cop_warnings);
+ PL_compiling.cop_warnings = pWARN_STD;
+ }
+ }
s++;
return s;
case 'W':