summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-dir.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2023-03-10 12:42:42 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2023-03-10 12:42:42 +0100
commit250c5684b9ee44ac972db51f87289ef935182c53 (patch)
tree4d2001bfc9e9575367c9f23c7d182b8c31d83d77 /tex/context/base/mkiv/l-dir.lua
parentc677baac37632308600b5108b586f80246056c74 (diff)
downloadcontext-250c5684b9ee44ac972db51f87289ef935182c53.tar.gz
2023-03-10 12:17:00
Diffstat (limited to 'tex/context/base/mkiv/l-dir.lua')
-rw-r--r--tex/context/base/mkiv/l-dir.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/l-dir.lua b/tex/context/base/mkiv/l-dir.lua
index c8543f025..3e24e4e2a 100644
--- a/tex/context/base/mkiv/l-dir.lua
+++ b/tex/context/base/mkiv/l-dir.lua
@@ -596,6 +596,27 @@ do
end
+ -- This go there anc check works okay in tricky situation as we encounter
+ -- on osx, where tex installations use rather complex chains of links.
+
+ function dir.expandlink(dir,report)
+ local curdir = currentdir()
+ local trace = type(report) == "function"
+ if chdir(dir) then
+ local newdir = currentdir()
+ if newdir ~= dir and trace then
+ report("following symlink %a to %a",dir,newdir)
+ end
+ chdir(curdir)
+ return newdir
+ else
+ if trace then
+ report("unable to check path %a",dir)
+ end
+ return dir
+ end
+ end
+
end
file.expandname = dir.expandname -- for convenience