[latex3-commits] [latex3/luaotfload] dev: More Windows path handling (7de976e3)

github at latex-project.org github at latex-project.org
Thu Feb 22 22:55:32 CET 2024


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/7de976e34e69e03ebc8f0cc84c3a9dca2498993d

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

commit 7de976e34e69e03ebc8f0cc84c3a9dca2498993d
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Thu Feb 22 22:55:32 2024 +0100

    More Windows path handling


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

7de976e34e69e03ebc8f0cc84c3a9dca2498993d
 src/luaotfload-realpath.lua | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/luaotfload-realpath.lua b/src/luaotfload-realpath.lua
index b180759c..34f60f4d 100644
--- a/src/luaotfload-realpath.lua
+++ b/src/luaotfload-realpath.lua
@@ -49,12 +49,10 @@ end
 
 local function lookup_split_path_in_tree(components, tree)
   if components[1] == '' then
-    if not windows_style_paths then
-      tree = tree_root
-    elseif components.drive then
-      tree = tree_root[components.drive]
+    if windows_style_paths then
+      tree = tree_root[components.drive or tree[path_components].drive]
     else
-      tree = tree_root[tree[path_components].drive]
+      tree = tree_root
     end
   end
   for i=1, #components do
@@ -72,8 +70,8 @@ tree_meta = {
   __index = function(parent, component)
     local parent_components = parent[path_components]
     local depth = #parent_components
-    local components = move(parent[path_components], 1, depth, 1, newtable(depth + 1, 0))
-    components[depth + 1] = component
+    local components = move(parent_components, 1, depth, 1, newtable(depth + 1, 1))
+    components.drive, components[depth + 1] = parent_components.drive, component
     local path = recombine_path(components)
 
     local mode = symlinkattributes(path, 'mode')





More information about the latex3-commits mailing list.