X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Fconfigmanager.lua;h=4cc3ef467f963b360d6dbb573a3641ded702b744;hb=14e478867b5e673654430ac8d3fe62bbd94a76d1;hp=839927dff59a2f7535ebc8b3d2dc4117b1ac03ce;hpb=6c0c01cb4fddd24024f54a0163c3d84a31eebc46;p=prosody.git diff --git a/core/configmanager.lua b/core/configmanager.lua index 839927df..4cc3ef46 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -47,6 +47,15 @@ function get(host, section, key) end return nil; end +function _M.rawget(host, section, key) + local hostconfig = rawget(config, host); + if hostconfig then + local sectionconfig = rawget(hostconfig, section); + if sectionconfig then + return rawget(sectionconfig, key); + end + end +end local function set(config, host, section, key, value) if host and section and key then @@ -221,10 +230,11 @@ do if file:match("[*?]") then local path_pos, glob = file:match("()([^"..path_sep.."]+)$"); local path = file:sub(1, math_max(path_pos-2,0)); + local config_path = config_file:gsub("[^"..path_sep.."]+$", ""); if #path > 0 then - path = resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), path); + path = resolve_relative_path(config_path, path); else - path = "."; + path = config_path; end local patt = glob_to_pattern(glob); for f in lfs.dir(path) do