Change 13737 by jhi@alpha on 2001/12/17 18:38:33

        Subject: [PATCH] -t and the core tests; -t and PERL5OPT
        From: Rafael Garcia-Suarez <[EMAIL PROTECTED]>
        Date: Mon, 17 Dec 2001 15:23:01 +0100
        Message-ID: <20011217152301.A704@rafael>

Affected files ...

.... //depot/perl/perl.c#401 edit
.... //depot/perl/pod/perldiag.pod#250 edit
.... //depot/perl/pod/perlrun.pod#47 edit
.... //depot/perl/t/run/runenv.t#5 edit

Differences ...

==== //depot/perl/perl.c#401 (text) ====
Index: perl/perl.c
--- perl/perl.c.~1~     Mon Dec 17 11:45:06 2001
+++ perl/perl.c Mon Dec 17 11:45:06 2001
@@ -1297,7 +1297,7 @@
                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 @@
                        break;
                    }
                }
-               moreswitches(d);
+               if (*d == 't') {
+                   PL_tainting = TRUE;
+                   PL_taint_warn = TRUE;
+               } else {
+                   moreswitches(d);
+               }
            }
        }
     }

==== //depot/perl/pod/perldiag.pod#250 (text) ====
Index: perl/pod/perldiag.pod
--- perl/pod/perldiag.pod.~1~   Mon Dec 17 11:45:06 2001
+++ perl/pod/perldiag.pod       Mon Dec 17 11:45:06 2001
@@ -1639,7 +1639,7 @@
 =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"
 

==== //depot/perl/pod/perlrun.pod#47 (text) ====
Index: perl/pod/perlrun.pod
--- perl/pod/perlrun.pod.~1~    Mon Dec 17 11:45:06 2001
+++ perl/pod/perlrun.pod        Mon Dec 17 11:45:06 2001
@@ -837,7 +837,7 @@
 =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

==== //depot/perl/t/run/runenv.t#5 (text) ====
Index: perl/t/run/runenv.t
--- perl/t/run/runenv.t.~1~     Mon Dec 17 11:45:06 2001
+++ perl/t/run/runenv.t Mon Dec 17 11:45:06 2001
@@ -16,7 +16,7 @@
 
 use Test;
 
-plan tests => 10;
+plan tests => 11;
 
 my $STDOUT = './results-0';
 my $STDERR = './results-1';
@@ -24,7 +24,7 @@
 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 @@
 
 #  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 @@
     '-w -w',
     '');
 
+try({PERL5OPT => '-t'},
+    ['-e', 'print ${^TAINT}'],
+    '1',
+    '');
+
 END {
     1 while unlink $STDOUT;
     1 while unlink $STDERR;
End of Patch.

Reply via email to