Mercurial > prosody-hg
comparison util/prosodyctl.lua @ 7462:ced4e800f42a
Merge 0.10->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 28 Jun 2016 14:54:43 +0100 |
| parents | 5e18416881bb |
| children | bd591c5fc1bf |
comparison
equal
deleted
inserted
replaced
| 7456:76a8456cf1e2 | 7462:ced4e800f42a |
|---|---|
| 42 end | 42 end |
| 43 | 43 |
| 44 local function getchar(n) | 44 local function getchar(n) |
| 45 local stty_ret = os.execute("stty raw -echo 2>/dev/null"); | 45 local stty_ret = os.execute("stty raw -echo 2>/dev/null"); |
| 46 local ok, char; | 46 local ok, char; |
| 47 if stty_ret == 0 then | 47 if stty_ret == true or stty_ret == 0 then |
| 48 ok, char = pcall(io.read, n or 1); | 48 ok, char = pcall(io.read, n or 1); |
| 49 os.execute("stty sane"); | 49 os.execute("stty sane"); |
| 50 else | 50 else |
| 51 ok, char = pcall(io.read, "*l"); | 51 ok, char = pcall(io.read, "*l"); |
| 52 if ok then | 52 if ok then |
