mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Corrected legacy use of the 'arg' table for manipulating varargs.
This commit is contained in:
@@ -111,13 +111,13 @@ function parse_file(filename, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- is filename a member of common_files? is second parameter a key in common_files or is it a table?
|
-- is filename a member of common_files? is second parameter a key in common_files or is it a table?
|
||||||
if common_files[filename] and type( arg[1] ) == "string" and common_files[filename][arg[1]] then
|
if common_files[filename] and type( (...) ) == "string" and common_files[filename][(...)] then
|
||||||
data_struct = { common_files[filename][arg[1]] }
|
data_struct = { common_files[filename][(...)] }
|
||||||
elseif common_files[filename] and #arg == 0 then
|
elseif common_files[filename] and select("#", ...) == 0 then
|
||||||
data_struct = { common_files[filename] }
|
data_struct = { common_files[filename] }
|
||||||
elseif type( arg[1] ) == "table" then
|
elseif type( (...) ) == "table" then
|
||||||
data_struct = arg
|
data_struct = {...}
|
||||||
elseif type( arg[1] ) ~= "table" then
|
elseif type( (...) ) ~= "table" then
|
||||||
return false, "Error in datafiles.parse_file: Expected second parameter as table."
|
return false, "Error in datafiles.parse_file: Expected second parameter as table."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user