mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
win32/resolv.rb: ad hoc workaround
* ext/win32/lib/win32/resolv.rb (Win32::Resolv::SZ): an ad hoc workaround for broken registry. SearchList and other registry values must be REG_SZ, or Windows ignores anything in those values otherwise. [ruby-dev:49924] [Bug #13081] https://github.com/rubygems/rubygems/issues/1700 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aa5ff4a43a
commit
3047144ac2
1 changed files with 15 additions and 0 deletions
|
@ -60,6 +60,21 @@ module Win32
|
||||||
# Windows NT
|
# Windows NT
|
||||||
#====================================================================
|
#====================================================================
|
||||||
module Resolv
|
module Resolv
|
||||||
|
module SZ
|
||||||
|
refine Registry do
|
||||||
|
# ad hoc workaround for broken registry
|
||||||
|
def read_s(key)
|
||||||
|
type, str = read(key)
|
||||||
|
unless type == Registry::REG_SZ
|
||||||
|
warn "Broken registry, #{name}\\#{key} was #{Registry.type2name(type)}, ignored"
|
||||||
|
return String.new
|
||||||
|
end
|
||||||
|
str
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
using SZ
|
||||||
|
|
||||||
TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
|
TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
Loading…
Add table
Reference in a new issue