summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--otfl-font-nms.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 5064e89..2461145 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -489,7 +489,13 @@ local function path_normalize(path)
if os.type ~= "windows" and os.type ~= "msdos" then
local dest = lfs.readlink(path)
if dest then
- path = file.join(file.dirname(path), dest)
+ if kpse.readable_file(dest) then
+ path = dest
+ elseif kpse.readable_file(file.join(file.dirname(path), dest)) then
+ path = file.join(file.dirname(path), dest)
+ else
+ -- broken symlink?
+ end
end
end
path = file.collapse_path(path)