Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 20:29:41 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329662 - head/stand/lua
Message-ID:  <201802202029.w1KKTfvM052715@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802202029.w1KKTfvM052715>