summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/resolv-replace.rb2
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a9cdd0..b7a328d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Mar 11 22:44:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv-replace.rb (TCPSocket#initialize): resolve the 3rd
+ argument only if non-nil value is given.
+ [ruby-dev:47150] [ruby-trunk - Bug #8054] reported and analyzed by
+ mrkn.
+
Mon Mar 11 19:22:54 2013 NAKAMURA Usaku <usa@ruby-lang.org>
* test/mkmf/base.rb: class name conflict.
diff --git a/lib/resolv-replace.rb b/lib/resolv-replace.rb
index ff34f90..3e28a84 100644
--- a/lib/resolv-replace.rb
+++ b/lib/resolv-replace.rb
@@ -19,7 +19,7 @@ class TCPSocket < IPSocket
alias original_resolv_initialize initialize
# :startdoc:
def initialize(host, serv, *rest)
- rest[0] = IPSocket.getaddress(rest[0]) unless rest.empty?
+ rest[0] = IPSocket.getaddress(rest[0]) if rest[0]
original_resolv_initialize(IPSocket.getaddress(host), serv, *rest)
end
end