summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/mkmf.rb11
2 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a21ed9d10..a1986c5b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
+Thu Sep 22 23:36:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (find_executable0): default path if environment is not
+ set. [ruby-dev:27281]
+
Thu Sep 22 17:31:48 2005 Shugo Maeda <shugo@ruby-lang.org>
-
+
* test/readline/test_readline.rb (TestReadline::replace_stdio):
merged the patch of [ruby-dev:25232] instead of [ruby-dev:25223].
(merged from ruby_1_8 branch)
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 29675b2d5..400d890aa 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -762,8 +762,17 @@ def what_type?(type, member = nil, headers = nil, &b)
end
def find_executable0(bin, path = nil)
- path = (path || ENV['PATH']).split(File::PATH_SEPARATOR)
ext = config_string('EXEEXT')
+ if File.expand_path(bin) == bin
+ return bin if File.executable?(bin)
+ return file if ext and File.executable?(file = bin + ext)
+ return nil
+ end
+ if path ||= ENV['PATH']
+ path = path.split(File::PATH_SEPARATOR)
+ else
+ path = %w[/usr/local/bin /usr/ucb /usr/bin /bin]
+ end
file = nil
path.each do |dir|
return file if File.executable?(file = File.join(dir, bin))