summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-12-24 21:39:26 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-12-24 21:39:26 +0000
commit0f9f2a42a4b54e497090940d18a852c15b2a1b8a (patch)
treefd20f7b53a5923bfe250b6c61a9cbf5f7a6d0b4c /libs
parent1b94b364980a5fa35f21eb861cc4c720390a2276 (diff)
libs/core: bring get_first() boolean casting in line with get_bool()
Diffstat (limited to 'libs')
-rw-r--r--libs/core/luasrc/model/uci.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/core/luasrc/model/uci.lua b/libs/core/luasrc/model/uci.lua
index 270877677f..e42856bd50 100644
--- a/libs/core/luasrc/model/uci.lua
+++ b/libs/core/luasrc/model/uci.lua
@@ -184,7 +184,8 @@ function Cursor.get_first(self, conf, stype, opt, def)
if type(def) == "number" then
val = tonumber(val)
elseif type(def) == "boolean" then
- val = (val == "1" or val == "true" or val == "enabled")
+ val = (val == "1" or val == "true" or
+ val == "yes" or val == "on")
end
if val ~= nil then