mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-10 05:02:40 +01:00
Фикс путей монтирования с одинаковой родительской директорией
This commit is contained in:
parent
5790e91610
commit
2d663fc1ed
@ -47,12 +47,16 @@ end
|
||||
|
||||
--------------------------------------- Mounted filesystem support -----------------------------------------
|
||||
|
||||
function filesystem.mount(cyka, path)
|
||||
function filesystem.mount(cyka, path)
|
||||
if type(cyka) == "table" then
|
||||
local mountedProxy
|
||||
|
||||
for i = 1, #mountedProxies do
|
||||
if mountedProxies[i].path == path then
|
||||
mountedProxy = mountedProxies[i]
|
||||
|
||||
if mountedProxy.path == path then
|
||||
return false, "mount path has been taken by other mounted filesystem"
|
||||
elseif mountedProxies[i].proxy == cyka then
|
||||
elseif mountedProxy.proxy == cyka then
|
||||
return false, "proxy is already mounted"
|
||||
end
|
||||
end
|
||||
@ -62,6 +66,8 @@ function filesystem.mount(cyka, path)
|
||||
proxy = cyka
|
||||
})
|
||||
|
||||
table.sort(mountedProxies, function(a, b) return #b.path < #a.path end)
|
||||
|
||||
return true
|
||||
else
|
||||
error("bad argument #1 (filesystem proxy expected, got " .. tostring(cyka) .. ")")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user