Fix problem when project directory has a trailing slash

This commit is contained in:
Francesco Abbate committed 2021-01-10 12:56:15 +01:00
1 parent 7f9e4e4984
commit fcf763fe9c
4 files changed
+28 -14

No files matched your search

+7
View File
@@ -196,6 +196,13 @@ function common.serialize(val)
end
function common.basename(path)
-- a path should never end by / or \ except if it is '/' (unix root) or
-- 'X:\' (windows drive)
return path:match("[^\\/]+$") or path
end
function common.home_encode(text)
if HOME then
local n = #HOME