summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-04-21 19:41:46 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-04-21 19:41:46 +0000
commit3cb299dc1077b7edee16e48255073603a3c694d8 (patch)
treebe6448cbf8796ff428f34212abc3c3d4bab5ea38
parentb748a908b86e97eaf7b0cee3c93dae9309739a5d (diff)
libs/cbi: try to load fully qualified model path first, drop support for .lua.gz models
-rw-r--r--libs/cbi/luasrc/cbi.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 6eeef0f787..e687164c25 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -62,12 +62,10 @@ function load(cbimap, ...)
local cbidir = luci.util.libpath() .. "/model/cbi/"
local func, err
- if fs.access(cbimap) then
- func, err = loadfile(cbimap)
- elseif fs.access(cbidir..cbimap..".lua") then
+ if fs.access(cbidir..cbimap..".lua") then
func, err = loadfile(cbidir..cbimap..".lua")
- elseif fs.access(cbidir..cbimap..".lua.gz") then
- func, err = loadfile(cbidir..cbimap..".lua.gz")
+ elseif fs.access(cbimap) then
+ func, err = loadfile(cbimap)
else
func, err = nil, "Model '" .. cbimap .. "' not found!"
end