mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
merge soc07 r5317:5322 - DNS zone transfer script.
This commit is contained in:
@@ -24,17 +24,17 @@ function strsplit(delimiter, text)
|
||||
local list = {}
|
||||
local pos = 1
|
||||
|
||||
if strfind("", delimiter, 1) then -- this would result in endless loops
|
||||
if string.find("", delimiter, 1) then -- this would result in endless loops
|
||||
error("delimiter matches empty string!")
|
||||
end
|
||||
|
||||
while 1 do
|
||||
local first, last = strfind(text, delimiter, pos)
|
||||
local first, last = string.find(text, delimiter, pos)
|
||||
if first then -- found?
|
||||
tinsert(list, strsub(text, pos, first-1))
|
||||
table.insert(list, string.sub(text, pos, first-1))
|
||||
pos = last+1
|
||||
else
|
||||
tinsert(list, strsub(text, pos))
|
||||
table.insert(list, string.sub(text, pos))
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user