From 75d8ec696b6c37035f71f5569365037244ed74be Mon Sep 17 00:00:00 2001 From: Moritz Wilhelmy Date: Sat, 22 Jun 2019 17:33:10 +0200 Subject: [PATCH] Lua 5.3 removed deprecated variadic function `arg' parameter Variadic functions were introduced in 5.0, but the method of accessing them changed in 5.1. This makes the code incompatible with 5.0 (it is already incompatible since at least b2b17559d), which will be removed from the build system in a subsequent commit. Fixes #124. See also #90. --- build/mkman.lua | 4 +--- ioncore/ioncore_misc.lua | 5 +---- mod_query/mod_query.lua | 1 + mod_statusbar/ion-statusd/statusd_mail.lua | 4 +--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/build/mkman.lua b/build/mkman.lua index c617d1e29..bc59ac263 100644 --- a/build/mkman.lua +++ b/build/mkman.lua @@ -10,8 +10,6 @@ local translations={} -local unpack = unpack or table.unpack - local function gettext(x) local t=translations[x] if not t or t=="" then @@ -22,7 +20,7 @@ local function gettext(x) end local function TR(x, ...) - return string.format(gettext(x), unpack(arg)) + return string.format(gettext(x), ...) end local function read_translations(pofile) diff --git a/ioncore/ioncore_misc.lua b/ioncore/ioncore_misc.lua index 35bad3466..2a55fddef 100644 --- a/ioncore/ioncore_misc.lua +++ b/ioncore/ioncore_misc.lua @@ -17,8 +17,6 @@ local layouts={ default = empty, } -local unpack = unpack or table.unpack - --DOC -- Define a new workspace layout with name \var{name}, and -- attach/creation parameters given in \var{tab}. The layout @@ -75,8 +73,7 @@ end --DOC -- gettext+string.format function ioncore.TR(s, ...) - local arg = {...} - return string.format(ioncore.gettext(s), unpack(arg)) + return string.format(ioncore.gettext(s), ...) end diff --git a/mod_query/mod_query.lua b/mod_query/mod_query.lua index 0196b0780..8ede3b675 100644 --- a/mod_query/mod_query.lua +++ b/mod_query/mod_query.lua @@ -1015,6 +1015,7 @@ function mod_query.do_handle_lua(mplex, env, code) local print_res local function collect_print(...) local tmp="" + local arg={...} local l=#arg for i=1,l do tmp=tmp..tostring(arg[i])..(i==l and "\n" or "\t") diff --git a/mod_statusbar/ion-statusd/statusd_mail.lua b/mod_statusbar/ion-statusd/statusd_mail.lua index 5025bde80..70ab15439 100644 --- a/mod_statusbar/ion-statusd/statusd_mail.lua +++ b/mod_statusbar/ion-statusd/statusd_mail.lua @@ -19,12 +19,10 @@ local defaults={ files = {} } -local unpack = unpack or table.unpack - local settings=table.join(statusd.get_config(mon), defaults) local function TR(s, ...) - return string.format(statusd.gettext(s), unpack(arg)) + return string.format(statusd.gettext(s), ...) end local function check_spool()