projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
090ce4f
)
libs/web: handle empty tables in Map.set()
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 5 Dec 2010 00:54:18 +0000
(
00:54
+0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 5 Dec 2010 00:54:18 +0000
(
00:54
+0000)
libs/web/luasrc/cbi.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/cbi.lua
b/libs/web/luasrc/cbi.lua
index 6934be6908090577c8228603f188cd4298f62789..f4bf18d1e7a5bb0bf5b671c0e3746bdf0f52d4e9 100644
(file)
--- a/
libs/web/luasrc/cbi.lua
+++ b/
libs/web/luasrc/cbi.lua
@@
-378,10
+378,14
@@
end
-- UCI set
function Map.set(self, section, option, value)
- if option then
- return self.uci:set(self.config, section, option, value)
+ if type(value) ~= "table" or #value > 0 then
+ if option then
+ return self.uci:set(self.config, section, option, value)
+ else
+ return self.uci:set(self.config, section, value)
+ end
else
- return
self.uci:set(self.config, section, value
)
+ return
Map.del(self, section, option
)
end
end