mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Remove the single-string special case in stdnse.format_output.
This should be handled by the generic case, and I don't think it was used anyway because the logic was wrong: if(indent == nil and #data == 1 and type(data) == 'string' and not(data['name']) and not(data['warning'])) then return data[1] end This seems to be checking for a one-element table whose single element is a string. But the test "#data == 1 and type(data) == 'string'" is actually testing for a one-byte string. I think this is supposed to be "type(data[1]) == 'string'", but anyway it should be handled by the generic case.
This commit is contained in:
parent
d9d47eb93d
commit
086b043cde
1 changed files with 0 additions and 5 deletions
|
|
@ -432,11 +432,6 @@ local function format_output_sub(status, data, indent)
|
|||
return ""
|
||||
end
|
||||
|
||||
-- Return a single line of output as-is (assuming it's top-level and a string)
|
||||
if(indent == nil and #data == 1 and type(data) == 'string' and not(data['name']) and not(data['warning'])) then
|
||||
return data[1]
|
||||
end
|
||||
|
||||
-- Used to put 'ERROR: ' in front of all lines on error messages
|
||||
local prefix = ""
|
||||
-- Initialize the output string to blank (or, if we're at the top, add a newline)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue