summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-03-29 07:24:48 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-03-29 07:24:48 +0200
commit2144889333ddc6fcd4293097ec884b9bd460c4ac (patch)
tree5278c2ee04111b1df22a42d6eeb14d9cf354c1e5
parent21ffe95c1b4a27a4e50769921a29546b277ef136 (diff)
downloadluaotfload-2144889333ddc6fcd4293097ec884b9bd460c4ac.tar.gz
Make sure names file exist before loading it
To protect against lua complaining about non existing file.
-rw-r--r--otfl-font-nms.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 5a31c56..5431c20 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -35,7 +35,12 @@ end
function names.load()
local localpath = names.path.localdir .. names.path.basename
local systempath = names.path.systemdir .. names.path.basename
- local data = dofile(localpath) or dofile(systempath)
+ local data
+ if file.isreadable(localpath) then
+ data = dofile(localpath)
+ elseif file.isreadable(systempath) then
+ data = dofile(systempath)
+ end
if data then
if trace_loading then
logs.report("load font", "loaded font names database: %s", foundname)