[latex3-commits] [git/LaTeX3-latex3-luaotfload] nosymlink: Don't follow symlinks when normalizing paths (db07890)

Marcel Fabian Krüger tex at 2krueger.de
Tue Jul 14 17:34:56 CEST 2020


Repository : https://github.com/latex3/luaotfload
On branch  : nosymlink
Link       : https://github.com/latex3/luaotfload/commit/db078909139721d7beed1c347728a093b7318c71

>---------------------------------------------------------------

commit db078909139721d7beed1c347728a093b7318c71
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Tue Jul 14 17:10:46 2020 +0200

    Don't follow symlinks when normalizing paths


>---------------------------------------------------------------

db078909139721d7beed1c347728a093b7318c71
 src/luaotfload-database.lua | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 2bfb0cb..68b1c8c 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -176,7 +176,6 @@ local utf8offset               = utf8.offset
 local context_environment      = luaotfload.fontloader
 local caches                   = context_environment.caches
 local filebasename             = file.basename
-local filecollapsepath         = file.collapsepath or file.collapse_path
 local filedirname              = file.dirname
 local fileextname              = file.extname
 local fileiswritable           = file.iswritable
@@ -1958,8 +1957,7 @@ do
     --- choose a normalization function in advance
     --- instead of testing with every call
     local os_type, os_name = os.type, os.name
-    local filecollapsepath = filecollapsepath
-    local lfsreadlink      = lfs.readlink
+    local filecollapsepath = file.collapsepath or file.collapse_path
 
     --- windows and dos
     if os_type == "windows" or os_type == "msdos" then
@@ -1977,20 +1975,7 @@ do
 --doc]]--
 
     else -- posix
-        function path_normalize (path)
-            local dest = lfsreadlink(path)
-            if dest then
-                if kpsereadable_file(dest) then
-                    path = dest
-                elseif kpsereadable_file(filejoin(filedirname(path), dest)) then
-                    path = filejoin(file.dirname(path), dest)
-                else
-                    -- broken symlink?
-                end
-            end
-            path = filecollapsepath(path)
-            return path
-        end
+        path_normalize = filecollapsepath
     end
 end
 





More information about the latex3-commits mailing list.