aboutsummaryrefslogtreecommitdiffstats
path: root/lib/resolv.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 20:04:27 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 20:04:27 +0000
commit570c028c7ebb18c6d276e5fac3a1b20f76f28db7 (patch)
tree632b274229b0854d82e1b655fe34cd5cff26f53d /lib/resolv.rb
parent8eb0c810b228df1f8352c005a7ae882ad4179b4b (diff)
downloadruby-570c028c7ebb18c6d276e5fac3a1b20f76f28db7.tar.gz
* lib/resolv.rb: fall back if canonicalization fails.
Thanks Vit Ondruch for the patch! [ruby-core:65836] * test/resolv/test_dns.rb: test for patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/resolv.rb')
-rw-r--r--lib/resolv.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 293e559acf..c19aeacd05 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -1066,6 +1066,10 @@ class Resolv
candidates = []
end
candidates.concat(@search.map {|domain| Name.new(name.to_a + domain)})
+ fname = Name.create("#{name}.")
+ if !candidates.include?(fname)
+ candidates << fname
+ end
end
return candidates
end