- $dirs = [ File::Spec->path ] unless $dirs;
- push @paths, map File::Spec->catfile($_, 'valgrind'), @$dirs
+ $dirs = [ File::Spec->path ] unless defined $dirs;
+ my $exe_name = 'valgrind';
+ $exe_name .= $Config::Config{exe_ext} if defined $Config::Config{exe_ext};
+ push @paths, map File::Spec->catfile($_, $exe_name), @$dirs