Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Nov 2019 03:41:31 +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: r354246 - head/stand/liblua
Message-ID:  <201911020341.xA23fVsW074260@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sat Nov  2 03:41:30 2019
New Revision: 354246
URL: https://svnweb.freebsd.org/changeset/base/354246

Log:
  liblua: add loader.lua_path
  
  As described previously, loader.lua_path is absolute path where scripts are
  installed. A future commit will use this to build paths for dofile in
  try_include, rather than the current pcall/require setup that makes it more
  difficult to coordinate loader aborts from local.lua -- we do not need the
  flexibility of require(), and local.lua is in-fact not a 'module-like' file
  as we will not be referencing anything from it.

Modified:
  head/stand/liblua/lutils.c

Modified: head/stand/liblua/lutils.c
==============================================================================
--- head/stand/liblua/lutils.c	Sat Nov  2 03:37:58 2019	(r354245)
+++ head/stand/liblua/lutils.c	Sat Nov  2 03:41:30 2019	(r354246)
@@ -384,6 +384,8 @@ luaopen_loader(lua_State *L)
 	lua_setfield(L, -2, "machine");
 	lua_pushstring(L, MACHINE_ARCH);
 	lua_setfield(L, -2, "machine_arch");
+	lua_pushstring(L, LUA_PATH);
+	lua_setfield(L, -2, "lua_path");
 	/* Set global printc to loader.printc */
 	lua_register(L, "printc", lua_printc);
 	return 1;



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