1
1

Slightly change find_program() to search the PATH manually; using

system("which ...") does not appear to work uniformly across different
platforms 

This commit was SVN r7775.
Этот коммит содержится в:
Jeff Squyres 2005-10-16 12:11:00 +00:00
родитель 7e45f64065
Коммит 9d5f597b7f

Просмотреть файл

@ -314,10 +314,10 @@ sub find_program {
# loop through the list and save the first one that we find # loop through the list and save the first one that we find
my $i = 0; my $i = 0;
while ($i <= $#names) { while ($i <= $#names) {
my $ret = system("which $names[$i] 2>&1 >/dev/null"); foreach my $dir (split(/:/, $ENV{PATH})) {
my $status = $ret >> 8; if (-x "$dir/$names[$i]") {
if ($status == 0) { return $names[$i];
return $names[$i]; }
} }
++$i; ++$i;
} }