]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/17-ctl.t
Preserve the PATH environment variable when running a sub-perl on cygwin
[perl/modules/Variable-Magic.git] / t / 17-ctl.t
index ca22761333c3a5e5959aaddd4d6fb50a1af1d2d0..31bab6668cfdd5b530cde71542f5d86994f215bc 100644 (file)
@@ -216,9 +216,10 @@ like $@, expect('tomato', undef, "\nBEGIN.*"),
 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;
+ $ENV{PATH}       = $PATH       if $^O eq 'cygwin'  and defined $PATH;
 
  system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code;
 }