diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-21 19:41:46 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-21 19:41:46 +0000 |
commit | 3cb299dc1077b7edee16e48255073603a3c694d8 (patch) | |
tree | be6448cbf8796ff428f34212abc3c3d4bab5ea38 /libs/cbi/luasrc | |
parent | b748a908b86e97eaf7b0cee3c93dae9309739a5d (diff) |
libs/cbi: try to load fully qualified model path first, drop support for .lua.gz models
Diffstat (limited to 'libs/cbi/luasrc')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 6eeef0f78..e687164c2 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 |