From ff15eeb08a3148f961b0535ee2fea7ceea85bc1a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 23 Apr 2014 08:17:51 +0200 Subject: [conf] fix configuration import --- src/luaotfload-configuration.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/luaotfload-configuration.lua') diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index aa91b27..fed003e 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -357,7 +357,8 @@ local process_options = function (opts) return new end -local apply = function (old, new) +local apply +apply = function (old, new) if not new then if not old then return false @@ -367,8 +368,19 @@ local apply = function (old, new) return tablecopy (new) end local result = tablecopy (old) - for var, val in next, new do - result[var] = val + for name, section in next, new do + local t_section = type (section) + if t_section ~= table_t then + logreport ("both", 1, "conf", + "Error applying configuration: entry %s is %s, expected table.", + section, t_section) + --- ignore + else + local currentsection = result[name] + for var, val in next, section do + currentsection[var] = val + end + end end return result end -- cgit v1.2.3