Fixed fs.path returning double slash for elements in root.

This commit is contained in:
Florian Nücke 2014-06-22 19:13:19 +02:00
parent 3ef3413586
commit d3560d17b6

View File

@ -228,7 +228,7 @@ end
function filesystem.path(path)
local parts = segments(path)
local result = table.concat(parts, "/", 1, #parts - 1) .. "/"
if unicode.sub(path, 1, 1) == "/" then
if unicode.sub(path, 1, 1) == "/" and unicode.sub(result, 1, 1) ~= "/" then
return "/" .. result
else
return result