summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-01-03 18:14:20 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-01-03 18:14:20 +0100
commitf1b0fea5a84d36326f456643d54368a4ab0a7040 (patch)
treec179b4ebce421157f8030cd9af887f90eb94641c /luaotfload-database.lua
parent9fd4c4523b1e69b5c49de7fda01da5540e60fcda (diff)
downloadluaotfload-f1b0fea5a84d36326f456643d54368a4ab0a7040.tar.gz
[db] handle missing metadata table
Fixes issue #164, hopefully.
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index b47fc8b..535aa7e 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -574,7 +574,16 @@ load_names = function (dry_run)
report ("info", 3, "db", "Loading took %0.f ms.",
1000 * (osgettimeofday () - starttime))
- local db_version, nms_version = data.meta.version, names.version
+ local db_version, nms_version
+ if data.meta then
+ db_version = data.meta.version
+ else
+ --- Compatibility branch; the version info used to be
+ --- stored in the table root which is why updating from
+ --- an earlier index version broke.
+ db_version = data.version or -42 --- invalid
+ end
+ nms_version = names.version
if db_version ~= nms_version then
report ("both", 0, "db",
[[Version mismatch; expected %4.3f, got %4.3f.]],