Fix error when opening root directory

This commit is contained in:
Francesco Abbate
2021-09-07 05:09:26 -07:00
parent f1c004411c
commit 3cc4cd1ada
+3 -1
View File
@@ -276,6 +276,7 @@ end
function common.normalize_path(filename) function common.normalize_path(filename)
if not filename then return end
if PATHSEP == '\\' then if PATHSEP == '\\' then
filename = filename:gsub('[/\\]', '\\') filename = filename:gsub('[/\\]', '\\')
local drive, rem = filename:match('^([a-zA-Z])(:.*)') local drive, rem = filename:match('^([a-zA-Z])(:.*)')
@@ -290,7 +291,8 @@ function common.normalize_path(filename)
table.insert(accu, part) table.insert(accu, part)
end end
end end
return table.concat(accu, PATHSEP) local npath = table.concat(accu, PATHSEP)
return npath == "" and PATHSEP or npath
end end