mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
resolv.rb: NUL hosts
* lib/resolv.rb (Resolv::Hosts::DefaultFileName): fallback to NUL device when Win32::Resolv.get_hosts_path() returned nil, to get rid of TypeError in lazy_initialize. [ruby-core:84907] [Bug #14369] [Fix GH-1791] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa5870b9c4
commit
456dc174b6
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ class Resolv
|
|||
begin
|
||||
raise LoadError unless /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
|
||||
require 'win32/resolv'
|
||||
DefaultFileName = Win32::Resolv.get_hosts_path
|
||||
DefaultFileName = Win32::Resolv.get_hosts_path || IO::NULL
|
||||
rescue LoadError
|
||||
DefaultFileName = '/etc/hosts'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue