1
0
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:
fyodor
2007-08-11 06:07:31 +00:00
parent 2b04b1c451
commit 5579ac94d3
2 changed files with 319 additions and 4 deletions

View File

@@ -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