mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +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:
parent
9d7ce06a96
commit
4d27d83f62
1 changed files with 3 additions and 4 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue