summaryrefslogtreecommitdiffhomepage
path: root/libs/uci/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-10-15 16:22:03 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-10-15 16:22:03 +0000
commit98187975f9ec118501b0867dc5ab39c234027ea3 (patch)
tree9f5ba9f45f0da563a3b5ed4b93a006e5995dd952 /libs/uci/luasrc/model
parentf7ab20f6e3a2720e166b4827b1a7570deadb43cf (diff)
libs/uci: fix attempt to assign empty tables in uci bind class
Diffstat (limited to 'libs/uci/luasrc/model')
-rw-r--r--libs/uci/luasrc/model/uci/bind.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/uci/luasrc/model/uci/bind.lua b/libs/uci/luasrc/model/uci/bind.lua
index 89ad3284c8..6f9060d224 100644
--- a/libs/uci/luasrc/model/uci/bind.lua
+++ b/libs/uci/luasrc/model/uci/bind.lua
@@ -126,7 +126,11 @@ end
function bsection.set(self, k, v, c)
local stat
if type(c) == "string" then
- stat = self:uciop("set", c, k, v)
+ if type(v) == "table" and #v == 0 then
+ stat = self:uciop("delete", c, k)
+ else
+ stat = self:uciop("set", c, k, v)
+ end
else
self:uciop("foreach", self.stype,
function(s)