Software /
code /
prosody
Diff
util/prosodyctl.lua @ 8634:f6f62c92b642
util.prosodyctl: Fix getpass() for new return values of os.execute() in Lua 5.2
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 20 Mar 2018 16:07:50 +0000 |
parent | 8123:bd591c5fc1bf |
child | 8668:31c5abd49dfe |
line wrap: on
line diff
--- 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