tFix menu input handling in text UI - sacc - sacc(omys), simple console gopher client (mirror) HTML git clone https://git.parazyd.org/sacc DIR Log DIR Files DIR Refs DIR LICENSE --- DIR commit 38704075332efd50523896ea0ae68275b7fe0a0f DIR parent f1216bbc6ea47edb1b8ca655ed7c2ebadaccce33 HTML Author: Quentin Rameau <quinq@fifth.space> Date: Fri, 1 Sep 2017 15:24:47 +0200 Fix menu input handling in text UI Also fix a typo introduced in 3eabb27 Diffstat: M ui_txt.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- DIR diff --git a/ui_txt.c b/ui_txt.c t@@ -172,10 +172,10 @@ uiselectitem(Item *entry) return NULL; nitems = dir ? dir->nitems : 0; - if (!c) - c = 'h'; for (;;) { + if (!c) + c = 'h'; printstatus(entry, c); fflush(stdout); t@@ -244,10 +244,7 @@ uiselectitem(Item *entry) continue; } - if (*buf < '0' || *buf > '9') - continue; - - if (item > 0 && item <= nitems); + if (item >= 0 && item <= nitems) break; }