# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1347557544 -3600
# Node ID cdbc86b69ea21ea8f67245593d65d6f45fb42a7b
# Parent  7c5c86fa552e614a03cff8cc26150556cd71e728# Parent  a4a74a0e9b9c84448d2506d43726762be6c2ca8c
Merge 0.9->trunk

diff -r 7c5c86fa552e -r cdbc86b69ea2 core/configmanager.lua
--- a/core/configmanager.lua	Thu Sep 13 00:32:12 2012 +0500
+++ b/core/configmanager.lua	Thu Sep 13 18:32:24 2012 +0100
@@ -247,11 +247,10 @@
 					end
 				end
 			else
+				local file = resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), file);
 				local f, err = io.open(file);
 				if f then
-					local data = f:read("*a");
-					local file = resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), file);
-					local ret, err = parsers.lua.load(data, file, config);
+					local ret, err = parsers.lua.load(f:read("*a"), file, config);
 					if not ret then error(err:gsub("%[string.-%]", file), 0); end
 				end
 				if not f then error("Error loading included "..file..": "..err, 0); end