From 47e3a20aa847cddfdbd41c16015f95d7856bda11 Mon Sep 17 00:00:00 2001 From: batrick Date: Wed, 8 Dec 2010 14:11:48 +0000 Subject: [PATCH] use better construction to iterate lines of a file --- nselib/unpwdb.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nselib/unpwdb.lua b/nselib/unpwdb.lua index ce54c5920..1446950d3 100644 --- a/nselib/unpwdb.lua +++ b/nselib/unpwdb.lua @@ -104,13 +104,7 @@ local filltable = function(filename, table) return false end - while true do - local l = file:read() - - if not l then - break - end - + for l in file:lines() do -- Comments takes up a whole line if not l:match("#!comment:") then table[#table + 1] = l