summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-02-12 07:38:16 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-02-12 07:38:16 +0000
commit74288ac80044d4682050dc85f8309429977cc884 (patch)
tree5debc814cf6c36734f29872af73d9058ff9e5e61 /perl.c
parent35cd451c5a1303394968903750cc3b3a1a6bc892 (diff)
downloadperl-74288ac80044d4682050dc85f8309429977cc884.tar.gz
PERL5OPT=-T enables taint mode (suggested by Jason Riedy <ejr@cise.ufl.edu>)
p4raw-id: //depot/perl@2880
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/perl.c b/perl.c
index c91c960632..9d47e22467 100644
--- a/perl.c
+++ b/perl.c
@@ -891,19 +891,25 @@ print \" \\@INC:\\n @INC\\n\";");
switch_end:
if (!PL_tainting && (s = PerlEnv_getenv("PERL5OPT"))) {
- while (s && *s) {
- while (isSPACE(*s))
- s++;
- if (*s == '-') {
- s++;
- if (isSPACE(*s))
- continue;
+ while (isSPACE(*s))
+ s++;
+ if (*s == '-' && *(s+1) == 'T')
+ PL_tainting = TRUE;
+ else {
+ while (s && *s) {
+ while (isSPACE(*s))
+ s++;
+ if (*s == '-') {
+ s++;
+ if (isSPACE(*s))
+ continue;
+ }
+ if (!*s)
+ break;
+ if (!strchr("DIMUdmw", *s))
+ croak("Illegal switch in PERL5OPT: -%c", *s);
+ s = moreswitches(s);
}
- if (!*s)
- break;
- if (!strchr("DIMUdmw", *s))
- croak("Illegal switch in PERL5OPT: -%c", *s);
- s = moreswitches(s);
}
}