check_program: do not fail on Windows for non-existent PATH entries
This commit is contained in:
1 parent
0344f02cb1
commit
a1bb9d81fd
3 files changed
+33
-14
No files matched your search
+12
-10
@@ -204,16 +204,18 @@ module Rscons
|
||||
File.file?(path) and File.executable?(path)
|
||||
end
|
||||
if RbConfig::CONFIG["host_os"] =~ /mswin|windows|mingw/i
|
||||
executable = executable.downcase
|
||||
dir_entries = Dir.entries(path_entry)
|
||||
dir_entries.find do |entry|
|
||||
path = "#{path_entry}/#{entry}"
|
||||
entry = entry.downcase
|
||||
if ((entry == executable) or
|
||||
(entry == "#{executable}.exe") or
|
||||
(entry == "#{executable}.com") or
|
||||
(entry == "#{executable}.bat")) and is_executable[path]
|
||||
return path
|
||||
if File.directory?(path_entry)
|
||||
executable = executable.downcase
|
||||
dir_entries = Dir.entries(path_entry)
|
||||
dir_entries.find do |entry|
|
||||
path = "#{path_entry}/#{entry}"
|
||||
entry = entry.downcase
|
||||
if ((entry == executable) or
|
||||
(entry == "#{executable}.exe") or
|
||||
(entry == "#{executable}.com") or
|
||||
(entry == "#{executable}.bat")) and is_executable[path]
|
||||
return path
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user