Make the code that manipulates the filename local to a function in banner.nse.

--script-updatedb didn't work because scripts don't have the filename variable
in their environment during that.
This commit is contained in:
david 2008-11-18 16:44:57 +00:00
parent 100aa9d122
commit 8247257ad0

View file

@ -40,9 +40,6 @@ action = function( host, port )
end
-- convert filename from full filepath to filename -extn
local filename = filename:match( "[\\/]([^\\/]+)\.nse$" )
---
-- Connects to the target on the given port and returns any data issued by a listening service.
@ -101,6 +98,8 @@ function output( out )
if type(out) ~= "string" or out == "" then return nil end
-- convert filename from full filepath to filename -extn
local filename = filename:match( "[\\/]([^\\/]+)\.nse$" )
local line_len = 75 -- The character width of command/shell prompt window.
local fline_offset = 5 -- number of chars excluding script id not available to the script on the first line