From 74288ac80044d4682050dc85f8309429977cc884 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 12 Feb 1999 07:38:16 +0000 Subject: PERL5OPT=-T enables taint mode (suggested by Jason Riedy ) p4raw-id: //depot/perl@2880 --- perl.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'perl.c') 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); } } -- cgit v1.2.1