summaryrefslogtreecommitdiffhomepage
path: root/core/src/dispatcher.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-24 14:11:15 +0000
committerSteven Barth <steven@midlink.org>2008-05-24 14:11:15 +0000
commit427dd0bd1dcaf081b21be96d6f0e73d542dd2f08 (patch)
tree07ffe38a02af13aaab512307addf696a2a814a4d /core/src/dispatcher.lua
parentf920f79b643b2a2c969228e06b4b9c5fcd097fe0 (diff)
* Added support for first-level controllers
* Added several posix functions to ffluci.fs * Added ffluci.util.combine
Diffstat (limited to 'core/src/dispatcher.lua')
-rw-r--r--core/src/dispatcher.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/src/dispatcher.lua b/core/src/dispatcher.lua
index a05c8805cb..e820a8864b 100644
--- a/core/src/dispatcher.lua
+++ b/core/src/dispatcher.lua
@@ -126,8 +126,14 @@ end
function createindex()
local root = ffluci.sys.libpath() .. "/controller/"
local suff = ".lua"
- for i,c in ipairs(ffluci.fs.glob(root .. "*/*" .. suff)) do
- c = "ffluci.controller." .. c:sub(#root+1, #c-#suff):gsub("/", ".", 1)
+
+ local controllers = ffluci.util.combine(
+ ffluci.fs.glob(root .. "*" .. suff),
+ ffluci.fs.glob(root .. "*/*" .. suff)
+ )
+
+ for i,c in ipairs(controllers) do
+ c = "ffluci.controller." .. c:sub(#root+1, #c-#suff):gsub("/", ".")
stat, mod = pcall(require, c)
if stat and mod and type(mod.index) == "function" then