Diff

net/dns.lua @ 1836:f4c88dd32724

Merge with 0.5
author Matthew Wild <mwild1@gmail.com>
date Sun, 27 Sep 2009 12:26:51 +0100
parent 1823:7c3ec7ac6316
parent 1827:fc21e8832848
child 1950:a1d186c8c65a
line wrap: on
line diff
--- a/net/dns.lua	Thu Sep 24 23:47:16 2009 +0100
+++ b/net/dns.lua	Sun Sep 27 12:26:51 2009 +0100
@@ -510,7 +510,7 @@
   local resolv_conf = io.open("/etc/resolv.conf");
   if resolv_conf then
 	  for line in resolv_conf:lines() do
-		local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
+		local address = line:gsub("#.*$", ""):match('^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
 		if address then self:addnameserver (address)  end
 	  end
   elseif os.getenv("WINDIR") then