summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 11:30:20 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 11:30:20 +0000
commitba02b2d689893b4ed12b1f01bf68a46f851f2bf9 (patch)
tree29c29d609f604d83cdda5ac5de2845dc51e8bd89 /ext
parent89fff52dfaa140931efb29f82eaee6d777e5e39d (diff)
merge revision(s) 15823:
* lib/resolv.rb (Resolv::Hosts): should not use win32/resolv on cygwin. [ruby-dev:29945], [ruby-dev:34095] * lib/win32/registry.rb (Win32::Registry.expand_environ): try upcased name too for cygwin. [ruby-dev:29945] * lib/win32/resolv.rb (Win32::Resolv.get_hosts_path): use expand_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/Win32API/lib/win32/registry.rb2
-rw-r--r--ext/Win32API/lib/win32/resolv.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/Win32API/lib/win32/registry.rb b/ext/Win32API/lib/win32/registry.rb
index 2671551..9a2f382 100644
--- a/ext/Win32API/lib/win32/registry.rb
+++ b/ext/Win32API/lib/win32/registry.rb
@@ -493,7 +493,7 @@ module Win32
# utility functions
#
def self.expand_environ(str)
- str.gsub(/%([^%]+)%/) { ENV[$1] || $& }
+ str.gsub(/%([^%]+)%/) { ENV[$1] || ENV[$1.upcase] || $& }
end
@@type2name = { }
diff --git a/ext/Win32API/lib/win32/resolv.rb b/ext/Win32API/lib/win32/resolv.rb
index 6534d20..92336fa 100644
--- a/ext/Win32API/lib/win32/resolv.rb
+++ b/ext/Win32API/lib/win32/resolv.rb
@@ -11,7 +11,7 @@ module Win32
def self.get_hosts_path
path = get_hosts_dir
- path = File.join(path.gsub(/\\/, File::SEPARATOR), 'hosts')
+ path = File.expand_path('hosts', path)
File.exist?(path) ? path : nil
end