mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
merge revision(s) 44312,44318,44321: [Backport #9273]
* lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not consider encodings in hosts file. [ruby-core:59239] [Bug #9273] * lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8058fde22f
commit
2f4529e7a6
5 changed files with 34 additions and 3 deletions
|
@ -186,7 +186,7 @@ class Resolv
|
|||
unless @initialized
|
||||
@name2addr = {}
|
||||
@addr2name = {}
|
||||
open(@filename) {|f|
|
||||
open(@filename, 'rb') {|f|
|
||||
f.each {|line|
|
||||
line.sub!(/#.*/, '')
|
||||
addr, hostname, *aliases = line.split(/\s+/)
|
||||
|
@ -889,7 +889,7 @@ class Resolv
|
|||
nameserver = []
|
||||
search = nil
|
||||
ndots = 1
|
||||
open(filename) {|f|
|
||||
open(filename, 'rb') {|f|
|
||||
f.each {|line|
|
||||
line.sub!(/[#;].*/, '')
|
||||
keyword, *args = line.split(/\s+/)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue