nuageinit: fix dirname('/') returning nil instead of '/'

This commit is contained in:
Baptiste Daroussin
2026-06-04 18:44:31 +02:00
parent 453968c78d
commit b813e46e15
+3
View File
@@ -93,6 +93,9 @@ local function dirname(oldpath)
end
local path = oldpath:gsub("[^/]+/*$", "")
if path == "" then
if oldpath:sub(1, 1) == "/" then
return "/"
end
return nil
end
return path