diff options
author | John E. Malmberg <wb8tyw@qsl.net> | 2007-11-11 14:09:17 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2007-11-12 04:33:08 +0000 |
commit | ff504b36b0f6467f64b463fd17fb34f640855abc (patch) | |
tree | 5398f0b66bc679c87e8c93623079f6ba793dd0da | |
parent | cdccec0ef10ce3464144f12459b52b13c346d2de (diff) | |
download | perl-ff504b36b0f6467f64b463fd17fb34f640855abc.tar.gz |
patch@32274 t/op/taint.t not cleaning up properly on VMS.
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-id: <4737B5CD.90209@qsl.net>
p4raw-id: //depot/perl@32278
-rwxr-xr-x | t/op/taint.t | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index bb238442b3..b2688cfe60 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -23,7 +23,11 @@ $| = 1; use vars qw($ipcsysv); # did we manage to load IPC::SysV? +my ($old_env_path, $old_env_dcl_path, $old_env_term); BEGIN { + $old_env_path = $ENV{'PATH'}; + $old_env_dcl_path = $ENV{'DCL$PATH'}; + $old_env_term = $ENV{'TERM'}; if ($^O eq 'VMS' && !defined($Config{d_setenv})) { $ENV{PATH} = $ENV{PATH}; $ENV{TERM} = $ENV{TERM} ne ''? $ENV{TERM} : 'dummy'; @@ -57,11 +61,22 @@ if ($Is_VMS) { for $x ('DCL$PATH', @MoreEnv) { ($old{$x}) = $ENV{$x} =~ /^(.*)$/ if exists $ENV{$x}; } + # VMS note: PATH and TERM are automatically created by the C + # library in VMS on reference to the their keys in %ENV. + # There is currently no way to determine if they did not exist + # before this test was run. eval <<EndOfCleanup; END { - \$ENV{PATH} = '' if $Config{d_setenv}; - warn "# Note: logical name 'PATH' may have been deleted\n"; + \$ENV{PATH} = \$old_env_path; + warn "# Note: logical name 'PATH' may have been created\n"; + \$ENV{'TERM'} = \$old_env_term; + warn "# Note: logical name 'TERM' may have been created\n"; \@ENV{keys %old} = values %old; + if (defined \$old_env_dcl_path) { + \$ENV{'DCL\$PATH'} = \$old_env_dcl_path; + } else { + delete \$ENV{'DCL\$PATH'}; + } } EndOfCleanup } |