lualoader: Replace invalid construct with valid construct

It only worked by coincidence, but it did work. Store varargs in a table
instead and work off of that.
This commit is contained in:
Kyle Evans 2018-02-20 20:29:41 +00:00
parent 6d03c5504b
commit 62daefa548
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329662

View File

@ -35,7 +35,14 @@ local password = require("password");
-- arguments passed as a lua function. This gives lua a chance to intercept
-- builtin CLI commands like "boot"
function cli_execute(...)
local cmd_name, cmd_args = ...;
local argv = {...};
-- Just in case...
if (#argv == 0) then
loader.command(...);
return;
end
local cmd_name = argv[1];
local cmd = _G[cmd_name];
if (cmd ~= nil) and (type(cmd) == "function") then
-- Pass argv wholesale into cmd. We could omit argv[0] since the