summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 11:29:46 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 11:29:46 +0000
commite5f3a01e31e23b1a437f658ad494a71e5111130b (patch)
tree9ce1d34622a14e88901f3aab5ddabe04951feecf
parent306831553d32b7fc083e3edc2336d9853c7a9968 (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_5@17212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--ext/Win32API/lib/win32/registry.rb2
-rw-r--r--ext/Win32API/lib/win32/resolv.rb2
-rw-r--r--lib/resolv.rb2
-rw-r--r--version.h2
5 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 26cb25b..a9f565d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Sun Jun 15 20:28:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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.
+
Sun Jun 15 20:27:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-mode): should use `run-mode-hooks' instead
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
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 49e40bd..898686f 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -278,7 +278,7 @@ class Resolv
end
class Hosts
- if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
+ if /mswin32|mingw|bccwin/ =~ RUBY_PLATFORM
require 'win32/resolv'
DefaultFileName = Win32::Resolv.get_hosts_path
else
diff --git a/version.h b/version.h
index 2549ef5..c6ed74a 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 186
+#define RUBY_PATCHLEVEL 187
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8