diff --git a/lib/resolv.rb b/lib/resolv.rb index 1044b95e68..56183b837d 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -188,7 +188,7 @@ class Resolv unless @initialized @name2addr = {} @addr2name = {} - open(@filename, 'rb') {|f| + File.open(@filename, 'rb') {|f| f.each {|line| line.sub!(/#.*/, '') addr, hostname, *aliases = line.split(/\s+/)