summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-04-02 14:02:12 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-04-02 14:02:12 +0200
commit4081b9d3af76fa03df2205254f0ae21481d0dfec (patch)
treeee18793b7444c69b0bb90f91da2a9c450124d348
parentb5d772765146e00f1f2f00d962e64b14a4fbb153 (diff)
downloadluaotfload-4081b9d3af76fa03df2205254f0ae21481d0dfec.tar.gz
Check if kpse can find font names database first
This way we can load font names database from working directory etc.
-rw-r--r--otfl-font-nms.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 54fce2b..5a7e460 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -39,8 +39,11 @@ end
function names.load()
local localpath = names.path.localdir .. names.path.basename
local systempath = names.path.systemdir .. names.path.basename
+ local kpsefound = kpse.find_file(names.path.basename)
local data
- if file.isreadable(localpath) then
+ if kpsefound and file.isreadable(kpsefound) then
+ data = dofile(kpsefound)
+ elseif file.isreadable(localpath) then
data = dofile(localpath)
elseif file.isreadable(systempath) then
data = dofile(systempath)