Merge 0.8->trunk
[prosody.git] / core / configmanager.lua
index 839927dff59a2f7535ebc8b3d2dc4117b1ac03ce..4cc3ef467f963b360d6dbb573a3641ded702b744 100644 (file)
@@ -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