]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Preserve the PATH environment variable when running a sub-perl on cygwin
authorVincent Pit <vince@profvince.com>
Sun, 23 Oct 2011 14:04:51 +0000 (16:04 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 23 Oct 2011 14:05:02 +0000 (16:05 +0200)
t/41-threads-teardown.t
t/50-external.t

index 42d4ae8e282151cbc4eb40db6c8fea8c24067b99..9de009fb0ba33b458f07547d858b5a12bb4591e6 100644 (file)
@@ -11,9 +11,10 @@ use Test::Leaner tests => 1;
 sub run_perl {
  my $code = shift;
 
 sub run_perl {
  my $code = shift;
 
- my $SystemRoot   = $ENV{SystemRoot};
+ my ($SystemRoot, $PATH) = @ENV{qw<SystemRoot PATH>};
  local %ENV;
  $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot;
  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;
 }
 
  system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code;
 }
index 2b318297eb101b66df6fe530955cd1a647801b37..5d3d37564b0e20987e51a429e9ab1d985c495c68 100644 (file)
@@ -10,9 +10,10 @@ BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
 sub run_perl {
  my $code = shift;
 
 sub run_perl {
  my $code = shift;
 
- my $SystemRoot   = $ENV{SystemRoot};
+ my ($SystemRoot, $PATH) = @ENV{qw<SystemRoot PATH>};
  local %ENV;
  $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot;
  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;
 }
 
  system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code;
 }