Fixed filesystem module misbehaving when no fs is mounted at root level.

This commit is contained in:
Florian Nücke 2014-05-22 22:43:36 +02:00
parent 5fb147e58c
commit 3913cf3fdc

View File

@ -299,11 +299,11 @@ end
function filesystem.list(path) function filesystem.list(path)
local node, rest, vnode, vrest = findNode(path) local node, rest, vnode, vrest = findNode(path)
if not vnode.fs and vrest and not node.fs then if not vnode.fs and vrest and not (node and node.fs) then
return nil, "no such file or directory" return nil, "no such file or directory"
end end
local result, reason local result, reason
if node.fs then if node and node.fs then
result, reason = node.fs.list(rest or "") result, reason = node.fs.list(rest or "")
end end
result = result or {} result = result or {}