mirror of
https://github.com/skywind3000/z.lua
synced 2026-03-16 20:59:48 +00:00
path insensitive detection in z_remove
This commit is contained in:
18
z.lua
18
z.lua
@@ -1187,15 +1187,25 @@ function z_remove(path)
|
||||
local M = data_load(DATA_FILE)
|
||||
local X = {}
|
||||
M = data_filter(M)
|
||||
local insensitive = path_case_insensitive()
|
||||
for _, path in pairs(paths) do
|
||||
path = os.path.abspath(path)
|
||||
remove[path] = 1
|
||||
if not insensitive then
|
||||
remove[path] = 1
|
||||
else
|
||||
remove[path:lower()] = 1
|
||||
end
|
||||
end
|
||||
for i = 1, #M do
|
||||
local item = M[i]
|
||||
if not remove[item.name] then
|
||||
table.insert(X, item)
|
||||
-- print('include:'..item.name)
|
||||
if not insensitive then
|
||||
if not remove[item.name] then
|
||||
table.insert(X, item)
|
||||
end
|
||||
else
|
||||
if not remove[item.name:lower()] then
|
||||
table.insert(X, item)
|
||||
end
|
||||
end
|
||||
end
|
||||
data_save(DATA_FILE, X)
|
||||
|
||||
Reference in New Issue
Block a user