From: Petr Špaček Date: Wed, 1 Nov 2017 16:52:12 +0000 (+0100) Subject: daemon: add ability to load modules with _ in name X-Git-Tag: v1.5.0~2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaea88d391c5136344a42a5242f0660a2d83c260;p=thirdparty%2Fknot-resolver.git daemon: add ability to load modules with _ in name --- diff --git a/daemon/lua/sandbox.lua b/daemon/lua/sandbox.lua index 63dbbb76d..5d57c22ef 100644 --- a/daemon/lua/sandbox.lua +++ b/daemon/lua/sandbox.lua @@ -113,7 +113,7 @@ setmetatable(modules, { if type(k) == 'number' then k = v v = nil end if not rawget(_G, k) then modules.load(k) - k = string.match(k, '%w+') + k = string.match(k, '[%w_]+') local mod = _G[k] local config = mod and rawget(mod, 'config') if mod ~= nil and config ~= nil then