ruby-changes:49780
From: nobu <ko1@a...>
Date: Thu, 18 Jan 2018 12:09:43 +0900 (JST)
Subject: [ruby-changes:49780] nobu:r61898 (trunk): resolv.rb: NUL hosts
nobu 2018-01-18 12:09:39 +0900 (Thu, 18 Jan 2018) New Revision: 61898 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61898 Log: 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] Modified files: trunk/lib/resolv.rb Index: lib/resolv.rb =================================================================== --- lib/resolv.rb (revision 61897) +++ lib/resolv.rb (revision 61898) @@ -169,7 +169,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L169 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/