1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-09 06:56:35 +00:00

Fixed a bug in stdnse.format_output() where the 'name' attribute of the top-most table wouldn't display

This commit is contained in:
ron
2010-11-20 16:18:18 +00:00
parent c12e4c93fb
commit f14a179b44

View File

@@ -460,18 +460,18 @@ local function format_output_sub(status, data, indent)
-- Make sure we have an indent value
indent = indent or {}
if(data['name']) then
if(data['warning'] and nmap.debugging() > 0) then
output = output .. format("%s%s%s (WARNING: %s)\n", format_get_indent(indent), prefix, data['name'], data['warning'])
else
output = output .. format("%s%s%s\n", format_get_indent(indent), prefix, data['name'])
end
elseif(data['warning'] and nmap.debugging() > 0) then
output = output .. format("%s%s(WARNING: %s)\n", format_get_indent(indent), prefix, data['warning'])
end
for i, value in ipairs(data) do
if(type(value) == 'table') then
if(value['name']) then
if(value['warning'] and nmap.debugging() > 0) then
output = output .. format("%s %s%s (WARNING: %s)\n", format_get_indent(indent), prefix, value['name'], value['warning'])
else
output = output .. format("%s %s%s\n", format_get_indent(indent), prefix, value['name'])
end
elseif(value['warning'] and nmap.debugging() > 0) then
output = output .. format("%s %s(WARNING: %s)\n", format_get_indent(indent), prefix, value['warning'])
end
-- Do a shallow copy of indent
local new_indent = {}
for _, v in ipairs(indent) do