Subject: | Windows path fix |
Hi,
Since some directories in $PATH can inclde spaces (like C:\Program Files)
the code needs to use th short pathname before calling MM->maybe_command.
I'm adding a small patch.
-Burak
Subject: | Cmd.diff |
--- Cmd.pm 2010-06-28 03:43:29.359200000 +0300
+++ C:\Perl\site\lib\IPC\Cmd.pm 2010-06-28 03:47:47.422200000 +0300
@@ -32,6 +32,7 @@
require FileHandle; FileHandle->import();
require Socket; Socket->import();
require Time::HiRes; Time::HiRes->import();
+ require Win32 if IS_WIN32;
};
$CAN_USE_RUN_FORKED = $@ || !IS_VMS && !IS_WIN32;
@@ -216,8 +217,9 @@
for my $dir (
(split /\Q$Config::Config{path_sep}\E/, $ENV{PATH}),
File::Spec->curdir
- ) {
- my $abs = File::Spec->catfile($dir, $command);
+ ) {
+ next if ! $dir || ! -d $dir;
+ my $abs = File::Spec->catfile( IS_WIN32 ? Win32::GetShortPathName( $dir ) : $dir, $command);
return $abs if $abs = MM->maybe_command($abs);
}
}