diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-21 12:27:00 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-21 12:27:00 +0000 |
| commit | 0200c8cc57d7c49af9e30ca7cf638f565b599ab5 (patch) | |
| tree | 77833f0bacb8c65038d2768b6920e57973c72bb3 /ext/dl/win32/lib | |
| parent | bcbd825f26c08397157f0fa5ca374bdf8fa3930f (diff) | |
| download | ruby-0200c8cc57d7c49af9e30ca7cf638f565b599ab5.tar.gz ruby-0200c8cc57d7c49af9e30ca7cf638f565b599ab5.tar.xz ruby-0200c8cc57d7c49af9e30ca7cf638f565b599ab5.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@15823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/win32/lib')
| -rw-r--r-- | ext/dl/win32/lib/win32/registry.rb | 2 | ||||
| -rw-r--r-- | ext/dl/win32/lib/win32/resolv.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/dl/win32/lib/win32/registry.rb b/ext/dl/win32/lib/win32/registry.rb index 2671551a3..9a2f3827b 100644 --- a/ext/dl/win32/lib/win32/registry.rb +++ b/ext/dl/win32/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/dl/win32/lib/win32/resolv.rb b/ext/dl/win32/lib/win32/resolv.rb index 6534d2076..92336fac2 100644 --- a/ext/dl/win32/lib/win32/resolv.rb +++ b/ext/dl/win32/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 |
