summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-12-29 18:46:25 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-30 15:57:25 +0000
commit317ea90d97caba0232674f77b3cbed1394243c39 (patch)
tree7759cdc2fb7ce9d3937aac6424fdd1da46ac68c1 /perl.c
parentd17aa069f1b4912cd5ee512e17998985c6151513 (diff)
downloadperl-317ea90d97caba0232674f77b3cbed1394243c39.tar.gz
-t without -w
Message-ID: <20011230044625.GA14386@blackrider> p4raw-id: //depot/perl@13953
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/perl.c b/perl.c
index 50e7aa1bcb..a96fbbd093 100644
--- a/perl.c
+++ b/perl.c
@@ -1100,11 +1100,15 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
break;
case 't':
- PL_taint_warn = TRUE;
- if (! (PL_dowarn & G_WARN_ALL_MASK))
- PL_dowarn |= G_WARN_ON;
+ if( !PL_tainting ) {
+ PL_taint_warn = TRUE;
+ PL_tainting = TRUE;
+ }
+ s++;
+ goto reswitch;
case 'T':
PL_tainting = TRUE;
+ PL_taint_warn = FALSE;
s++;
goto reswitch;
@@ -1283,8 +1287,10 @@ print \" \\@INC:\\n @INC\\n\";");
char *popt = s;
while (isSPACE(*s))
s++;
- if (*s == '-' && *(s+1) == 'T')
+ if (*s == '-' && *(s+1) == 'T') {
PL_tainting = TRUE;
+ PL_taint_warn = FALSE;
+ }
else {
char *popt_copy = Nullch;
while (s && *s) {
@@ -1313,8 +1319,10 @@ print \" \\@INC:\\n @INC\\n\";");
}
}
if (*d == 't') {
- PL_tainting = TRUE;
- PL_taint_warn = TRUE;
+ if( !PL_tainting ) {
+ PL_taint_warn = TRUE;
+ PL_tainting = TRUE;
+ }
} else {
moreswitches(d);
}
@@ -1322,6 +1330,10 @@ print \" \\@INC:\\n @INC\\n\";");
}
}
+ if (PL_taint_warn && PL_dowarn != G_WARN_ALL_OFF) {
+ PL_compiling.cop_warnings = newSVpvn(WARN_TAINTstring, WARNsize);
+ }
+
if (!scriptname)
scriptname = argv[0];
if (PL_e_script) {
@@ -2509,11 +2521,15 @@ Internet, point your browser at http://www.perl.com/, the Perl Home Page.\n\n");
return s;
case 'W':
PL_dowarn = G_WARN_ALL_ON|G_WARN_ON;
+ if (!specialWARN(PL_compiling.cop_warnings))
+ SvREFCNT_dec(PL_compiling.cop_warnings);
PL_compiling.cop_warnings = pWARN_ALL ;
s++;
return s;
case 'X':
PL_dowarn = G_WARN_ALL_OFF;
+ if (!specialWARN(PL_compiling.cop_warnings))
+ SvREFCNT_dec(PL_compiling.cop_warnings);
PL_compiling.cop_warnings = pWARN_NONE ;
s++;
return s;