forked from osmarks/potatOS
Fix VFS list bug
This commit is contained in:
parent
3542ab25c1
commit
d3a43eab28
@ -200,7 +200,7 @@ local function create_FS(vfstree)
|
|||||||
return node.mount or node.vfs
|
return node.mount or node.vfs
|
||||||
end
|
end
|
||||||
|
|
||||||
local function resolve(sandbox_path)
|
local function resolve(sandbox_path, ignore_usability)
|
||||||
local segs = segments(sandbox_path)
|
local segs = segments(sandbox_path)
|
||||||
local current_tree = vfstree
|
local current_tree = vfstree
|
||||||
|
|
||||||
@ -217,6 +217,7 @@ local function create_FS(vfstree)
|
|||||||
current_tree = current_tree.children[seg]
|
current_tree = current_tree.children[seg]
|
||||||
else break end
|
else break end
|
||||||
end
|
end
|
||||||
|
if ignore_usability then return current_tree, segs end
|
||||||
return last_usable_node, last_segs
|
return last_usable_node, last_segs
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -282,7 +283,6 @@ local function create_FS(vfstree)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function new.mountVFS(path, vfs)
|
function new.mountVFS(path, vfs)
|
||||||
local path = canonicalize(path)
|
|
||||||
local node, relpath = resolve(path)
|
local node, relpath = resolve(path)
|
||||||
while #relpath > 0 do
|
while #relpath > 0 do
|
||||||
local seg = table.remove(relpath, 1)
|
local seg = table.remove(relpath, 1)
|
||||||
@ -303,8 +303,8 @@ local function create_FS(vfstree)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function new.list(path)
|
function new.list(path)
|
||||||
local node, segs = resolve(path)
|
local node, segs = resolve(path, true)
|
||||||
local vfs, path = resolve_node_segs(node, segs)
|
local vfs, path = resolve_path(path)
|
||||||
if #segs > 0 then return vfs.list(path) end
|
if #segs > 0 then return vfs.list(path) end
|
||||||
local out = {}
|
local out = {}
|
||||||
local seen = {}
|
local seen = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user