mirror of
https://github.com/nmap/nmap.git
synced 2025-12-21 15:09:02 +00:00
Fix to make SCRIPT_NAME not have a filename extension in certain situations.
See [1]. [1] http://seclists.org/nmap-dev/2011/q3/304
This commit is contained in:
@@ -386,10 +386,9 @@ do
|
|||||||
"Warning: Loading '%s' -- the recommended file extension is '.nse'.",
|
"Warning: Loading '%s' -- the recommended file extension is '.nse'.",
|
||||||
filename);
|
filename);
|
||||||
end
|
end
|
||||||
local basename = match(filename, "[/\\]([^/\\]-)$") or filename;
|
local basename = match(filename, "([^/\\]+)$") or filename;
|
||||||
local short_basename = match(filename, "[/\\]([^/\\]-)%.nse$") or
|
local short_basename = match(filename, "([^/\\]+)%.nse$") or
|
||||||
match(filename, "[/\\]([^/\\]-)%.[^.]*$") or
|
match(filename, "([^/\\]+)%.[^.]*$") or filename;
|
||||||
filename;
|
|
||||||
local file_closure = assert(loadfile(filename));
|
local file_closure = assert(loadfile(filename));
|
||||||
-- Give the closure its own environment, with global access
|
-- Give the closure its own environment, with global access
|
||||||
local env = {
|
local env = {
|
||||||
|
|||||||
Reference in New Issue
Block a user