From: Rafael Garcia-Suarez Date: Mon, 17 Dec 2001 15:23:01 +0000 (+0100) Subject: -t and the core tests; -t and PERL5OPT X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c4db469cd1e8fb8078f63d9771e14df964cc680;p=p5sagit%2Fp5-mst-13.2.git -t and the core tests; -t and PERL5OPT Message-ID: <20011217152301.A704@rafael> p4raw-id: //depot/perl@13737 --- diff --git a/perl.c b/perl.c index a27620a..d75b20d 100644 --- a/perl.c +++ b/perl.c @@ -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 7a7661a..83baed2 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 9de9a3e..726a69d 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 55c48f0..236f84e 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;