Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2018 04:59:21 +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: r329359 - head/stand/lua
Message-ID:  <201802160459.w1G4xLe9037119@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Fri Feb 16 04:59:21 2018
New Revision: 329359
URL: https://svnweb.freebsd.org/changeset/base/329359

Log:
  stand/lua: Remove a magic number/string (not a trivial literal)
  
  We'll arbitrarily use KEYSTR_ for string representations of non-trivial
  characters.

Modified:
  head/stand/lua/core.lua
  head/stand/lua/menu.lua

Modified: head/stand/lua/core.lua
==============================================================================
--- head/stand/lua/core.lua	Fri Feb 16 04:50:14 2018	(r329358)
+++ head/stand/lua/core.lua	Fri Feb 16 04:59:21 2018	(r329359)
@@ -32,6 +32,8 @@ local core = {};
 core.KEY_ENTER = 13;
 core.KEY_BACKSPACE = 127;
 
+core.KEYSTR_ESCAPE = "\027";
+
 function core.setVerbose(b)
 	if (b == nil) then
 		b = not core.verbose;

Modified: head/stand/lua/menu.lua
==============================================================================
--- head/stand/lua/menu.lua	Fri Feb 16 04:50:14 2018	(r329358)
+++ head/stand/lua/menu.lua	Fri Feb 16 04:59:21 2018	(r329359)
@@ -161,7 +161,7 @@ menu.welcome = {
 		name = function()
 			return color.highlight("Esc").."ape to loader prompt";
 		end,
-		alias = {"\027"}
+		alias = {core.KEYSTR_ESCAPE}
 	},
 
 	-- reboot



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