Fixed luci.uci.Cursor.delete_all

This commit is contained in:
Steven Barth 2008-09-05 12:05:06 +00:00
parent f62839fde9
commit 9cae9dabf2

View file

@ -31,7 +31,7 @@ local table = require "table"
local setmetatable, rawget, rawset = setmetatable, rawget, rawset local setmetatable, rawget, rawset = setmetatable, rawget, rawset
local error, pairs, ipairs, tostring = error, pairs, ipairs, tostring local error, pairs, ipairs, tostring = error, pairs, ipairs, tostring
local require, getmetatable = require, getmetatable local require, getmetatable, type = require, getmetatable, type
--- LuCI UCI model library. --- LuCI UCI model library.
-- @cstyle instance -- @cstyle instance
@ -67,7 +67,7 @@ end
-- @param type UCI section type -- @param type UCI section type
-- @param comparator Function that will be called for each section and -- @param comparator Function that will be called for each section and
-- returns a boolean whether to delete the current section (optional) -- returns a boolean whether to delete the current section (optional)
function Cursor.delete_all(self, config, type, comparator) function Cursor.delete_all(self, config, stype, comparator)
local del = {} local del = {}
if type(comparator) == "table" then if type(comparator) == "table" then
@ -89,7 +89,7 @@ function Cursor.delete_all(self, config, type, comparator)
end end
end end
self:foreach(config, type, helper) self:foreach(config, stype, helper)
for i, j in ipairs(del) do for i, j in ipairs(del) do
self:delete(config, j) self:delete(config, j)