diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-09-13 18:31:34 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-09-13 18:31:34 +0100 |
commit | 6063b9a08ed5a43d090513ad283acb404aa51522 (patch) | |
tree | d623bc815c27a8e2141421fc54f7fbbc61ac1a21 | |
parent | a79c507ade52c12c691a1eb79fbf80f0cba5be77 (diff) | |
download | prosody-6063b9a08ed5a43d090513ad283acb404aa51522.tar.gz prosody-6063b9a08ed5a43d090513ad283acb404aa51522.zip |
configmanager: Fix include of relative files via Include directive in config
-rw-r--r-- | core/configmanager.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua index 8fea3be5..51b9f5fe 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -247,11 +247,10 @@ do 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 |