From 519b72e6e989a18ede51fddddfa87f20a32ea29e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 21 Dec 2010 22:25:54 +0000 Subject: configmanager: Filenames without a path are also relative to the config file path, not the current working directory --- core/configmanager.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/configmanager.lua') diff --git a/core/configmanager.lua b/core/configmanager.lua index 839927df..b703bb8c 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -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 -- cgit v1.2.3