From cf8022c740a11f5fcf01b5e7bd93c522a1b78adc Mon Sep 17 00:00:00 2001 From: Cormac Shannon <> Date: Mon, 23 Mar 2026 19:01:50 +0000 Subject: [PATCH] Move _LUSH_VERSION global into luaopen_base alongside _VERSION --- lbaselib.c | 4 ++++ lua.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lbaselib.c b/lbaselib.c index 891bb90f..a9598b99 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -540,6 +540,7 @@ static const luaL_Reg base_funcs[] = { /* placeholders */ {LUA_GNAME, NULL}, {"_VERSION", NULL}, + {"_LUSH_VERSION", NULL}, {NULL, NULL} }; @@ -554,6 +555,9 @@ LUAMOD_API int luaopen_base (lua_State *L) { /* set global _VERSION */ lua_pushliteral(L, LUA_VERSION); lua_setfield(L, -2, "_VERSION"); + /* set global _LUSH_VERSION */ + lua_pushliteral(L, LUSH_VERSION); + lua_setfield(L, -2, "_LUSH_VERSION"); return 1; } diff --git a/lua.c b/lua.c index 68bfc290..3d105917 100644 --- a/lua.c +++ b/lua.c @@ -834,8 +834,6 @@ static int pmain (lua_State *L) { lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); } luai_openlibs(L); /* open standard libraries */ - lua_pushstring(L, LUSH_VERSION); - lua_setglobal(L, "_LUSH_VERSION"); createargtable(L, argv, argc, script); /* create table 'arg' */ lua_gc(L, LUA_GCRESTART); /* start GC... */ lua_gc(L, LUA_GCGEN); /* ...in generational mode */