lib/execjs/external_runtime.rb in execjs-1.2.12 vs lib/execjs/external_runtime.rb in execjs-1.2.13
- old
+ new
@@ -128,10 +128,11 @@
if File.executable? cmd
cmd
else
path = ENV['PATH'].split(File::PATH_SEPARATOR).find { |p|
- File.executable? File.join(p, cmd)
+ full_path = File.join(p, cmd)
+ File.executable?(full_path) && File.file?(full_path)
}
path && File.expand_path(cmd, path)
end
end