From: Vincent Pit Date: Sun, 23 Oct 2011 14:04:51 +0000 (+0200) Subject: Preserve the PATH environment variable when running a sub-perl on cygwin X-Git-Tag: v0.26~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=eab9532b534e1c2efca5410ae4502af7ce43f941;p=perl%2Fmodules%2Findirect.git Preserve the PATH environment variable when running a sub-perl on cygwin --- diff --git a/t/41-threads-teardown.t b/t/41-threads-teardown.t index 42d4ae8..9de009f 100644 --- a/t/41-threads-teardown.t +++ b/t/41-threads-teardown.t @@ -11,9 +11,10 @@ use Test::Leaner tests => 1; sub run_perl { my $code = shift; - my $SystemRoot = $ENV{SystemRoot}; + my ($SystemRoot, $PATH) = @ENV{qw}; local %ENV; $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot; + $ENV{PATH} = $PATH if $^O eq 'cygwin' and defined $PATH; system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code; } diff --git a/t/50-external.t b/t/50-external.t index 2b31829..5d3d375 100644 --- a/t/50-external.t +++ b/t/50-external.t @@ -10,9 +10,10 @@ BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } sub run_perl { my $code = shift; - my $SystemRoot = $ENV{SystemRoot}; + my ($SystemRoot, $PATH) = @ENV{qw}; local %ENV; $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot; + $ENV{PATH} = $PATH if $^O eq 'cygwin' and defined $PATH; system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code; }