Fix error when opening root directory
This commit is contained in:
parent
f1c004411c
commit
3cc4cd1ada
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue