From 8247257ad02d627f62ef142ab94ca6735df0cd1d Mon Sep 17 00:00:00 2001 From: david Date: Tue, 18 Nov 2008 16:44:57 +0000 Subject: [PATCH] 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. --- scripts/banner.nse | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/banner.nse b/scripts/banner.nse index b51b70d46..00e2f946b 100644 --- a/scripts/banner.nse +++ b/scripts/banner.nse @@ -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