diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-03-20 16:07:50 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-03-20 16:07:50 +0000 |
commit | da2030e5ad8327fe1523953724b0aa0d70534e06 (patch) | |
tree | 223cf53271e0a6fa394e7d524b51fee61227d741 /util/prosodyctl.lua | |
parent | d176928882bd19d394f5b85efc794f038871b659 (diff) | |
download | prosody-da2030e5ad8327fe1523953724b0aa0d70534e06.tar.gz prosody-da2030e5ad8327fe1523953724b0aa0d70534e06.zip |
util.prosodyctl: Fix getpass() for new return values of os.execute() in Lua 5.2
Diffstat (limited to 'util/prosodyctl.lua')
-rw-r--r-- | util/prosodyctl.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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 |