tFix status current url in text UI - sacc - sacc(omys), simple console gopher client (mirror) (HTM) git clone https://git.parazyd.org/sacc (DIR) Log (DIR) Files (DIR) Refs (DIR) LICENSE --- (DIR) commit 723df46be763ef55707fd3c63c8f70b0920ff17b (DIR) parent df00adaaab6055bb54114462d6b219dbefc34e9f (HTM) Author: Quentin Rameau <quinq@fifth.space> Date: Sun, 1 Oct 2017 12:41:55 +0200 Fix status current url in text UI Diffstat: M ui_txt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- (DIR) diff --git a/ui_txt.c b/ui_txt.c t@@ -76,13 +76,15 @@ static void printstatus(Item *item, char c) { Dir *dir = item->dat; + char *fmt; size_t nitems = dir ? dir->nitems : 0; unsigned long long printoff = dir ? dir->printoff : 0; - printf("%3lld%%%*c %s:%s%s [%c]: ", - (printoff + lines >= nitems) ? 100 : + fmt = (strcmp(item->port, "70") && strcmp(item->port, "gopher")) ? + "%3lld%%%*c %s:%7$s/%c%s [%c]" : "%3lld%%%*c %s/%c%s [%c]"; + printf(fmt, (printoff + lines-1 >= nitems) ? 100 : (printoff + lines) * 100 / nitems, ndigits(nitems)+2, '|', - item->host, item->port, item->selector, c); + item->host, item->type, item->selector, c, item->port); } char *