summaryrefslogtreecommitdiff
path: root/lib/resolv-replace.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-11 13:47:04 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-11 13:47:04 +0000
commitb1f2effda85efd03bd4ad5c06e0aae5e14f3f864 (patch)
tree3c01813cf2bb16182e96cccfeef95ec349367bcc /lib/resolv-replace.rb
parent79ea4d627ffc38c9754123c7535dc264dfc8e74e (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/resolv-replace.rb')
-rw-r--r--lib/resolv-replace.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/resolv-replace.rb b/lib/resolv-replace.rb
index ff34f90db46..3e28a843fd9 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