]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/ioncore_bindings.lua
Imported Upstream version 20090110
[ion3.git] / ioncore / ioncore_bindings.lua
index 5f11967db2f52b76abafe5970920a4b24d4865ea..01588ebaed474057aff36fb5be578232a71d2746 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- ion/share/ioncore-bindings.lua
 -- 
--- Copyright (c) Tuomo Valkonen 2004-2007.
+-- Copyright (c) Tuomo Valkonen 2004-2009.
 --
 -- See the included file LICENSE for details.
 --
@@ -46,7 +46,8 @@ function ioncore.compile_cmd(cmd, guard)
         end
         
         local gfncode="return function(_, _sub, _chld) "..guardcode.." return true end"
-        local gfn, gerr=loadstring(gfncode, guardcode)
+        local gerr
+        gfn, gerr=loadstring(gfncode, guardcode)
         if not gfn then
             ioncore.warn_traced(TR("Error compiling guard: %s", gerr))
         end
@@ -59,7 +60,7 @@ function ioncore.compile_cmd(cmd, guard)
         else
             return function(_, _sub, _chld) 
                 if gfn(_, _sub, _chld) then 
-                    cmd(_, _sub, _chld) 
+                    fn(_, _sub, _chld) 
                 end
             end
         end