diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-11-24 19:20:07 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-11-24 19:20:07 +0000 |
commit | 4dcc49be8ec6bc080c91a0fcce1879736750ae73 (patch) | |
tree | 8fefafc2607a1fcc4d473331228afe65edc25bf3 /src | |
parent | updated TODO (diff) |
tab vs space
git-svn-id: https://svn.spreadspace.org/gcsd/trunk@60 ac14a137-c7f1-4531-abe0-07747231d213
Diffstat (limited to 'src')
-rw-r--r-- | src/dispatch_table.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/dispatch_table.lua b/src/dispatch_table.lua index 912394a..7783113 100644 --- a/src/dispatch_table.lua +++ b/src/dispatch_table.lua @@ -39,13 +39,13 @@ function dispatch_table:load_handler_table_file(filename) local defines = require('defines') if (type(filename) ~= "nil") then if (type(filename) ~= "string") then - log.printf(log.ERROR, "filename must be of type 'string' and denote a valid path") - return defines.KILL_DAEMON + log.printf(log.ERROR, "filename must be of type 'string' and denote a valid path") + return defines.KILL_DAEMON end local chunk = loadfile(filename) if (not chunk) then - log.printf(log.ERROR, "failed to load lua-file '%s'", filename) - return defines.KILL_DAEMON + log.printf(log.ERROR, "failed to load lua-file '%s'", filename) + return defines.KILL_DAEMON end self:register_handler_table(chunk()) log.printf(log.NOTICE, "loaded dispatch table from file %s", filename) @@ -65,13 +65,13 @@ function dispatch_table:dispatch(command_buffer) repeat local had_match = false for regex, handler in pairs(self.regex_to_handler) do - local match = string.match(command_buffer, "^" .. regex, init) - if match then - handler(match) - had_match = true - init = init + string.len(match) - break - end + local match = string.match(command_buffer, "^" .. regex, init) + if match then + handler(match) + had_match = true + init = init + string.len(match) + break + end end until (not had_match) |