aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2026-06-04 16:44:31 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2026-06-04 16:44:31 +0000
commitb813e46e153327b66db4791ec0003b7e7cc51214 (patch)
tree261627315cc3dae54ed770900b81d44d0a842f7e
parent453968c78d27ed5c90562a1178f34fe8d616bf40 (diff)
nuageinit: fix dirname('/') returning nil instead of '/'
-rw-r--r--libexec/nuageinit/nuage.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua
index f3c23a7c3eb8..839cf3588021 100644
--- a/libexec/nuageinit/nuage.lua
+++ b/libexec/nuageinit/nuage.lua
@@ -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