Skip to content

Commit

Permalink
Lua 5.3 removed deprecated variadic function `arg' parameter
Browse files Browse the repository at this point in the history
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 b2b1755), which will be removed
from the build system in a subsequent commit.

Fixes raboof#124. See also raboof#90.
  • Loading branch information
wilhelmy committed Jun 22, 2019
1 parent e93a847 commit 75d8ec6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions build/mkman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions ioncore/ioncore_misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
1 change: 1 addition & 0 deletions mod_query/mod_query.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 1 addition & 3 deletions mod_statusbar/ion-statusd/statusd_mail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 75d8ec6

Please sign in to comment.