diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2001-12-17 16:23:01 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-17 18:38:33 +0000 |
commit | 1c4db469cd1e8fb8078f63d9771e14df964cc680 (patch) | |
tree | 77ffc105327ed21c5767507956765036a630f6d1 | |
parent | 1689481e5512794ca867be78f00013097fdd63c0 (diff) | |
download | perl-1c4db469cd1e8fb8078f63d9771e14df964cc680.tar.gz |
-t and the core tests; -t and PERL5OPT
Message-ID: <20011217152301.A704@rafael>
p4raw-id: //depot/perl@13737
-rw-r--r-- | perl.c | 9 | ||||
-rw-r--r-- | pod/perldiag.pod | 2 | ||||
-rw-r--r-- | pod/perlrun.pod | 2 | ||||
-rw-r--r-- | t/run/runenv.t | 11 |
4 files changed, 17 insertions, 7 deletions
@@ -1297,7 +1297,7 @@ print \" \\@INC:\\n @INC\\n\";"); d = s; if (!*s) break; - if (!strchr("DIMUdmw", *s)) + if (!strchr("DIMUdmtw", *s)) Perl_croak(aTHX_ "Illegal switch in PERL5OPT: -%c", *s); while (++s && *s) { if (isSPACE(*s)) { @@ -1310,7 +1310,12 @@ print \" \\@INC:\\n @INC\\n\";"); break; } } - moreswitches(d); + if (*d == 't') { + PL_tainting = TRUE; + PL_taint_warn = TRUE; + } else { + moreswitches(d); + } } } } diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 7a7661a8c6..83baed2745 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1639,7 +1639,7 @@ Interpretation of the octal number stopped before the 8 or 9. =item Illegal switch in PERL5OPT: %s (X) The PERL5OPT environment variable may only be used to set the -following switches: B<-[DIMUdmw]>. +following switches: B<-[DIMUdmtw]>. =item Ill-formed CRTL environ value "%s" diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 9de9a3e710..726a69dad8 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -837,7 +837,7 @@ The program should instead say: =item PERL5OPT Command-line options (switches). Switches in this variable are taken -as if they were on every Perl command line. Only the B<-[DIMUdmw]> +as if they were on every Perl command line. Only the B<-[DIMUdmtw]> switches are allowed. When running taint checks (because the program was running setuid or setgid, or the B<-T> switch was used), this variable is ignored. If PERL5OPT begins with B<-T>, tainting will be diff --git a/t/run/runenv.t b/t/run/runenv.t index 55c48f03b3..236f84eabb 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -16,7 +16,7 @@ BEGIN { use Test; -plan tests => 10; +plan tests => 11; my $STDOUT = './results-0'; my $STDERR = './results-1'; @@ -24,7 +24,7 @@ my $PERL = './perl'; my $FAILURE_CODE = 119; # Run perl with specified environment and arguments returns a list. -# First element is true iff Perl's stdout and stderr match the +# First element is true if Perl's stdout and stderr match the # supplied $stdout and $stderr argument strings exactly. # second element is an explanation of the failure sub runperl { @@ -79,7 +79,7 @@ sub try { # PERL5OPT Command-line options (switches). Switches in # this variable are taken as if they were on -# every Perl command line. Only the -[DIMUdmw] +# every Perl command line. Only the -[DIMUdmtw] # switches are allowed. When running taint # checks (because the program was running setuid # or setgid, or the -T switch was used), this @@ -140,6 +140,11 @@ try({PERL5OPT => '-w -w'}, '-w -w', ''); +try({PERL5OPT => '-t'}, + ['-e', 'print ${^TAINT}'], + '1', + ''); + END { 1 while unlink $STDOUT; 1 while unlink $STDERR; |