From 46ce09a994b7f5a2be6f564e5767d0302884d7d9 Mon Sep 17 00:00:00 2001 From: batrick Date: Mon, 9 Jun 2008 02:23:22 +0000 Subject: [PATCH] Minor optimizations to stdnse.lua Fixed stdnse.lua to use a default name for module() --- nselib/stdnse.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nselib/stdnse.lua b/nselib/stdnse.lua index 56da3b531..3cdd7be80 100644 --- a/nselib/stdnse.lua +++ b/nselib/stdnse.lua @@ -1,6 +1,6 @@ -- See nmaps COPYING for licence -module(..., package.seeall) +module(... or "stdnse", package.seeall) print_debug = function(...) local verbosity = 1; @@ -25,9 +25,7 @@ function strsplit(delimiter, text) local list = {} local pos = 1 - if string.find("", delimiter, 1) then -- this would result in endless loops - error("delimiter matches empty string!") - end + assert(delimiter ~= "", "delimiter matches empty string!"); while true do local first, last = string.find(text, delimiter, pos)