mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 05:31:31 +00:00
Change module separator to directory separator as is done in
Lua's ?.lua loader. This is necessary when requiring submodules e.g. require "foo.bar"
This commit is contained in:
@@ -119,6 +119,7 @@ local cnse, rules = ...; -- The NSE C library and Script Rules
|
|||||||
|
|
||||||
do -- Add loader to look in nselib/?.lua (nselib/ can be in multiple places)
|
do -- Add loader to look in nselib/?.lua (nselib/ can be in multiple places)
|
||||||
local function loader (lib)
|
local function loader (lib)
|
||||||
|
lib = lib:gsub("%.", "/"); -- change Lua "module seperator" to directory separator
|
||||||
local name = "nselib/"..lib..".lua";
|
local name = "nselib/"..lib..".lua";
|
||||||
local type, path = cnse.fetchfile_absolute(name);
|
local type, path = cnse.fetchfile_absolute(name);
|
||||||
if type == "file" then
|
if type == "file" then
|
||||||
|
|||||||
Reference in New Issue
Block a user