diff options
author | Kim Alvefur <zash@zash.se> | 2021-04-25 17:32:27 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-04-25 17:32:27 +0200 |
commit | 75ca81a26e86df0fae6a39913d9ff2ff480e2211 (patch) | |
tree | e25ca9727f25781af49b97d56df0b32f6a02b4ba | |
parent | 549a0aa28fab6a0d18c3b6d83a5bc588c2c5d004 (diff) | |
download | prosody-75ca81a26e86df0fae6a39913d9ff2ff480e2211.tar.gz prosody-75ca81a26e86df0fae6a39913d9ff2ff480e2211.zip |
util.prosodyctl.shell: Fix for different location of unpack in Lua 5.1
-rw-r--r-- | util/prosodyctl/shell.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/prosodyctl/shell.lua b/util/prosodyctl/shell.lua index 4e112a14..79d96f15 100644 --- a/util/prosodyctl/shell.lua +++ b/util/prosodyctl/shell.lua @@ -3,6 +3,7 @@ local server = require "net.server"; local st = require "util.stanza"; local path = require "util.paths"; local parse_args = require "util.argparse".parse; +local unpack = table.unpack or _G.unpack; local have_readline, readline = pcall(require, "readline"); @@ -75,7 +76,7 @@ local function start(arg) --luacheck: ignore 212/arg if arg[2] then -- prosodyctl shell module reload foo bar.com --> module:reload("foo", "bar.com") -- COMPAT Lua 5.1 doesn't have the separator argument to string.rep - arg[1] = string.format("%s:%s("..string.rep("%q, ", #arg-2):sub(1, -3)..")", table.unpack(arg)); + arg[1] = string.format("%s:%s("..string.rep("%q, ", #arg-2):sub(1, -3)..")", unpack(arg)); end client.events.add_handler("connected", function() |