summaryrefslogtreecommitdiff
path: root/ext/dl/win32
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/win32')
-rw-r--r--ext/dl/win32/lib/win32/registry.rb2
-rw-r--r--ext/dl/win32/lib/win32/resolv.rb2
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 2671551a33c..9a2f3827b7a 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 6534d20760a..92336fac28f 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