Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

When looking for a command in PATH, one should also check whether it'…

…s a regular file instead of just checking the executable bit, in order to avoid detecting directories as commands. Fixes issue #59.
  • Loading branch information...
commit 792656726751ebf43e3dc891412fb303363dbb39 1 parent 421756c
@FooBarWidget authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  distro/platform_info.rb
View
2  distro/platform_info.rb
@@ -223,7 +223,7 @@ def self.solaris_ld?
def self.find_command(name)
ENV['PATH'].split(File::PATH_SEPARATOR).detect do |directory|
path = File.join(directory, name.to_s)
- if File.executable?(path)
+ if File.file?(path) && File.executable?(path)
return path
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.