summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-04-23 08:17:51 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-04-23 08:17:51 +0200
commitff15eeb08a3148f961b0535ee2fea7ceea85bc1a (patch)
tree93411b8612e5efd374832ad2f62f8e9eaa4e69fa
parent2237a2bc833d46a1631112fb4c220e3f4941bcc3 (diff)
downloadluaotfload-ff15eeb08a3148f961b0535ee2fea7ceea85bc1a.tar.gz
[conf] fix configuration import
-rw-r--r--src/luaotfload-configuration.lua18
1 files changed, 15 insertions, 3 deletions
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