From 56a757fc5af4f8911d372e48adf7ba1071935e52 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 20 Mar 2018 16:07:50 +0000 Subject: util.prosodyctl: Fix getpass() for new return values of os.execute() in Lua 5.2 --- util/prosodyctl.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util/prosodyctl.lua') diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index 8ae051ae..0da28cfa 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -66,7 +66,10 @@ local function getline() end local function getpass() - local stty_ret = os.execute("stty -echo 2>/dev/null"); + local stty_ret, _, status_code = os.execute("stty -echo 2>/dev/null"); + if status_code then -- COMPAT w/ Lua 5.1 + stty_ret = status_code; + end if stty_ret ~= 0 then io.write("\027[08m"); -- ANSI 'hidden' text attribute end -- cgit v1.2.3