From 1674a5aa95a3305845364daee05c2ec8279e2703 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg42.2a@gmail.com>
Date: Mon, 2 Sep 2013 00:07:25 +0200
Subject: [db] adjust index field for non tt collections

---
 luaotfload-database.lua | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index a148940..e5627ef 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -1559,7 +1559,6 @@ local compare_timestamps = function (fullname,
     if  currenttimestamp == targettimestamp
     and not targetentrystatus.index [1]
     then
-
         --- copy old namedata into new
 
         for _, currentindex in next, currententrystatus.index do
@@ -1590,7 +1589,13 @@ local insert_fullinfo = function (fullname,
                                   targetentrystatus,
                                   info)
 
-    local subfont = n_font and n_font - 1 or false
+    local subfont
+    if n_font ~= false then
+        subfont = n_font - 1
+    else
+        subfont = false
+        n_font  = 1
+    end
 
     local fullinfo = loader (fullname, subfont,
                              location, basename,
@@ -2567,6 +2572,7 @@ local retrieve_namedata = function (currentnames,
                                     dry_run,
                                     n_rawnames,
                                     n_newnames)
+
     local rawnames, new = scan_texmf_fonts (currentnames,
                                             targetnames,
                                             dry_run)
-- 
cgit v1.2.3