Changeset

3929:7cb03d67101b

configmanager: Filenames without a path are also relative to the config file path, not the current working directory
author Matthew Wild <mwild1@gmail.com>
date Tue, 21 Dec 2010 22:25:54 +0000
parents 3928:4dfb345e33ec
children 3930:46d9cf613bb1
files core/configmanager.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/configmanager.lua	Tue Dec 21 15:26:37 2010 +0000
+++ b/core/configmanager.lua	Tue Dec 21 22:25:54 2010 +0000
@@ -221,10 +221,11 @@
 			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