[latex3-commits] [latex3/luaotfload] database-iteration-refactor: Implement dummy for windows (fa96bf07)

github at latex-project.org github at latex-project.org
Sun Jan 28 15:39:04 CET 2024


Repository : https://github.com/latex3/luaotfload
On branch  : database-iteration-refactor
Link       : https://github.com/latex3/luaotfload/commit/fa96bf07d5a317ad0d509c52083611a64ceb6679

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

commit fa96bf07d5a317ad0d509c52083611a64ceb6679
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sun Jan 28 15:38:54 2024 +0100

    Implement dummy for windows


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

fa96bf07d5a317ad0d509c52083611a64ceb6679
 src/luaotfload-realpath.lua | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/luaotfload-realpath.lua b/src/luaotfload-realpath.lua
index 7840074b..8587b896 100644
--- a/src/luaotfload-realpath.lua
+++ b/src/luaotfload-realpath.lua
@@ -2,6 +2,7 @@
 
 local sub = string.sub
 local symlinkattributes = lfs.symlinkattributes
+local attributes = lfs.attributes
 local currentdir = lfs.currentdir
 local concat = table.concat
 local move = table.move
@@ -98,10 +99,19 @@ local function resolve_path_to_tree(path)
   end
 end
 
-local function resolve_path(path)
-  local tree, err = resolve_path_to_tree(path)
-  if not tree then return tree, err end
-  return concat(tree[path_components], '/'), tree[file_mode]
+local resolve_path = ({
+  unix = function(path)
+    local tree, err = resolve_path_to_tree(path)
+    if not tree then return tree, err end
+    return concat(tree[path_components], '/'), tree[file_mode]
+  end,
+})[os.type] or function(path)
+  local mode, err = attributes(path)
+  if mode then
+    return path, mode
+  else
+    return mode, err
+  end
 end
 
 return {





More information about the latex3-commits mailing list.