configmanager: Filenames without a path are also relative to the config file path...
authorMatthew Wild <mwild1@gmail.com>
Tue, 21 Dec 2010 22:25:54 +0000 (22:25 +0000)
committerMatthew Wild <mwild1@gmail.com>
Tue, 21 Dec 2010 22:25:54 +0000 (22:25 +0000)
core/configmanager.lua

index 839927dff59a2f7535ebc8b3d2dc4117b1ac03ce..b703bb8c6b92d8540ed20b32894db5638b0a9fe3 100644 (file)
@@ -221,10 +221,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