From 862852012389d94834f6e77a3a01a7da41c67ce9 Mon Sep 17 00:00:00 2001 From: batrick Date: Tue, 20 Sep 2011 18:24:09 +0000 Subject: [PATCH] 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" --- nse_main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nse_main.lua b/nse_main.lua index 62530add8..496028656 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -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) local function loader (lib) + lib = lib:gsub("%.", "/"); -- change Lua "module seperator" to directory separator local name = "nselib/"..lib..".lua"; local type, path = cnse.fetchfile_absolute(name); if type == "file" then