Skip to content

Commit

Permalink
Awesome 4.3 patch (lua54 compatibility) (#232)
Browse files Browse the repository at this point in the history
* Patch to fix version info when using Lua5.4

Due to a change in Lua's 'request' built-in, Awesome's version flag now
returns bad data when using Lua5.4. This patch handles that change
without breaking earlier implementations, by only looking at the first
returned value of 'request'.
  • Loading branch information
sage-etcher authored May 6, 2024
1 parent f51d687 commit f60ff6a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Awesome/4.3/01-fix-lua54-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
As of Lua5.4 'require' returns both the version number and a path to the
version file. Awesome's version function expects the builtin to only return
the version number. This patch chops off all extra returns and presents it
as though it only returned 1 value.

--- ../common/version.c.orig 2024-05-02 18:29:54.116685697 -0400
+++ ../common/version.c 2024-05-02 18:59:59.483356091 -0400
@@ -48,7 +48,9 @@
lua_pop(L, 1);

/* Either push version number or error message onto stack */
+ int top = lua_gettop(L);
(void) luaL_dostring(L, "return require('lgi.version')");
+ lua_pop(L, lua_gettop(L) - top - 1);

#ifdef WITH_DBUS
const char *has_dbus = "yes";

0 comments on commit f60ff6a

Please sign in to comment.