svn commit: r329662 - head/stand/lua
Kyle Evans
kevans at FreeBSD.org
Tue Feb 20 20:29:41 UTC 2018
Author: kevans
Date: Tue Feb 20 20:29:41 2018
New Revision: 329662
URL: https://svnweb.freebsd.org/changeset/base/329662
Log:
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.
Modified:
head/stand/lua/loader.lua
Modified: head/stand/lua/loader.lua
==============================================================================
--- head/stand/lua/loader.lua Tue Feb 20 20:26:48 2018 (r329661)
+++ head/stand/lua/loader.lua Tue Feb 20 20:29:41 2018 (r329662)
@@ -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
More information about the svn-src-all
mailing list