mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Minor optimizations to stdnse.lua
Fixed stdnse.lua to use a default name for module()
This commit is contained in:
parent
d47e9fd66d
commit
46ce09a994
1 changed files with 2 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue