aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-04-25 17:32:27 +0200
committerKim Alvefur <zash@zash.se>2021-04-25 17:32:27 +0200
commit75ca81a26e86df0fae6a39913d9ff2ff480e2211 (patch)
treee25ca9727f25781af49b97d56df0b32f6a02b4ba /util
parent549a0aa28fab6a0d18c3b6d83a5bc588c2c5d004 (diff)
downloadprosody-75ca81a26e86df0fae6a39913d9ff2ff480e2211.tar.gz
prosody-75ca81a26e86df0fae6a39913d9ff2ff480e2211.zip
util.prosodyctl.shell: Fix for different location of unpack in Lua 5.1
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/shell.lua3
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()