# HG changeset patch # User Matthew Wild # Date 1521562070 0 # Node ID f6f62c92b642fe36364992638473aa0ad61ba426 # Parent 8ec18a002c30147fd76b6742ae6eee9b962499cf util.prosodyctl: Fix getpass() for new return values of os.execute() in Lua 5.2 diff -r 8ec18a002c30 -r f6f62c92b642 util/prosodyctl.lua --- a/util/prosodyctl.lua Mon Mar 19 16:40:40 2018 +0000 +++ b/util/prosodyctl.lua Tue Mar 20 16:07:50 2018 +0000 @@ -66,7 +66,10 @@ 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