util.prosodyctl: Handle os.execute in Lua 5.2 returning true when command terminates...
authorKim Alvefur <zash@zash.se>
Thu, 23 Jun 2016 19:07:48 +0000 (21:07 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 23 Jun 2016 19:07:48 +0000 (21:07 +0200)
util/prosodyctl.lua

index cde1cdd4ce7b839d07648835c2948eeaf25dbcd7..7c9a3c19dcf7c0edb6ab95959627d197a429cb45 100644 (file)
@@ -44,7 +44,7 @@ end
 local function getchar(n)
        local stty_ret = os.execute("stty raw -echo 2>/dev/null");
        local ok, char;
-       if stty_ret == 0 then
+       if stty_ret == true or stty_ret == 0 then
                ok, char = pcall(io.read, n or 1);
                os.execute("stty sane");
        else