From 98187975f9ec118501b0867dc5ab39c234027ea3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 15 Oct 2009 16:22:03 +0000 Subject: libs/uci: fix attempt to assign empty tables in uci bind class --- libs/uci/luasrc/model/uci/bind.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libs/uci') diff --git a/libs/uci/luasrc/model/uci/bind.lua b/libs/uci/luasrc/model/uci/bind.lua index 89ad3284c..6f9060d22 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) -- cgit v1.2.3