From: Rafael Garcia-Suarez Date: Fri, 5 Jan 2007 14:37:31 +0000 (+0000) Subject: Fix the interaction of -w and -t when provided on the command-line X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2e5e6ba5e47d15a5738d4108c62ba11afc28b4c;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/perl.c b/perl.c index 4f9fdac..37671b1 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': diff --git a/pp_ctl.c b/pp_ctl.c index 459c5a8..48f2ed6 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3389,7 +3389,7 @@ PP(pp_require) PL_compiling.cop_warnings = pWARN_ALL ; else if (PL_dowarn & G_WARN_ALL_OFF) PL_compiling.cop_warnings = pWARN_NONE ; - else if (PL_taint_warn) { + else if (PL_taint_warn && !(PL_dowarn & G_WARN_ON)) { PL_compiling.cop_warnings = Perl_new_warnings_bitfield(aTHX_ NULL, WARN_TAINTstring, WARNsize); }