[ruby-dev:49932] [Ruby trunk Bug#13081] resolv.rb may be the cause of the rubygems bug on Windows

From: kou@...
Date: 2016-12-29 12:27:09 UTC
List: ruby-dev #49932
Issue #13081 has been updated by Kouhei Sutou.


How about ignoring the registry value if its type is not expected type?

```diff
Index: resolv.rb
===================================================================
--- resolv.rb	(revision 57233)
+++ resolv.rb	(working copy)
@@ -75,8 +75,10 @@
         nameserver = get_dns_server_list
         Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
           begin
-            slist = reg.read_s('SearchList')
-            search = slist.split(/,\s*/) unless slist.empty?
+            type, slist = reg.read('SearchList')
+            if type == Registory::REG_SZ
+              search = slist.split(/,\s*/) unless slist.empty?
+            end
           rescue Registry::Error
           end
```


----------------------------------------
Bug #13081: resolv.rb may be the cause of the rubygems bug on Windows
https://bugs.ruby-lang.org/issues/13081#change-62321

* Author: Kozo Nishida
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
See https://github.com/rubygems/rubygems/issues/1700



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next