mirror of
https://github.com/nmap/nmap.git
synced 2025-12-21 06:59:01 +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'.",
|
||||
filename);
|
||||
end
|
||||
local basename = match(filename, "[/\\]([^/\\]-)$") or filename;
|
||||
local short_basename = match(filename, "[/\\]([^/\\]-)%.nse$") or
|
||||
match(filename, "[/\\]([^/\\]-)%.[^.]*$") or
|
||||
filename;
|
||||
local basename = match(filename, "([^/\\]+)$") or filename;
|
||||
local short_basename = match(filename, "([^/\\]+)%.nse$") or
|
||||
match(filename, "([^/\\]+)%.[^.]*$") or filename;
|
||||
local file_closure = assert(loadfile(filename));
|
||||
-- Give the closure its own environment, with global access
|
||||
local env = {
|
||||
|
||||
Reference in New Issue
Block a user