diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-03-10 12:42:42 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-03-10 12:42:42 +0100 |
commit | 250c5684b9ee44ac972db51f87289ef935182c53 (patch) | |
tree | 4d2001bfc9e9575367c9f23c7d182b8c31d83d77 /tex/context/base/mkiv/l-dir.lua | |
parent | c677baac37632308600b5108b586f80246056c74 (diff) | |
download | context-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.lua | 21 |
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 |