fixed big bug

This commit is contained in:
IonutParau 2025-05-29 18:40:17 +02:00
parent e9de55dbc2
commit 09048f4a93

View File

@ -142,20 +142,22 @@ libcomponent = {
list = function(filter, exact) list = function(filter, exact)
checkArg(1, filter, "string", "nil") checkArg(1, filter, "string", "nil")
local t = component.list() local t = component.list()
if not filter then return t end local list = t
local list = {} if filter then
for addr, kind in pairs(t) do list = {}
if type(exact) == "boolean" and exact then for addr, kind in pairs(t) do
if kind == filter then if type(exact) == "boolean" and exact then
list[addr] = kind if kind == filter then
end list[addr] = kind
elseif rawequal(exact, "pattern") then end
if string.match(kind, filter) then elseif rawequal(exact, "pattern") then
list[addr] = kind if string.match(kind, filter) then
end list[addr] = kind
else end
if string.find(kind, filter, nil, true) then else
list[addr] = kind if string.find(kind, filter, nil, true) then
list[addr] = kind
end
end end
end end
end end