summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-01-05 14:37:31 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-01-05 14:37:31 +0000
commitb2e5e6ba5e47d15a5738d4108c62ba11afc28b4c (patch)
treef1dcb439321ece30fdbae25aff4d26bbca65cb07 /perl.c
parent0f4f294e5ec7fa2d3de004ee7c15e0fdd37e7dfc (diff)
downloadperl-b2e5e6ba5e47d15a5738d4108c62ba11afc28b4c.tar.gz
Fix the interaction of -w and -t when provided on the command-line
and/or on the shebang line : do not reset the warning bits to 'only taint'. p4raw-id: //depot/perl@29698
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':