tFix current url display in screen UI - sacc - sacc (saccomys): simple gopher client.
Log
Files
Refs
LICENSE
---
commit c69cb6fe7293ab237206addbbc89e809e6f3d26e
parent 90277d09e34282cbd7c21fbc6b0f5190aca3df21
Author: Quentin Rameau 
Date:   Sun,  3 Sep 2017 20:59:46 +0200

Fix current url display in screen UI

Diffstat:
  ui_ti.c                             |       7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/ui_ti.c b/ui_ti.c
t@@ -147,6 +147,7 @@ static void
 displaystatus(Item *item)
 {
         Dir *dir = item->dat;
+        char *fmt;
         size_t nitems = dir ? dir->nitems : 0;
         unsigned long long printoff = dir ? dir->printoff : 0;
         int n;
t@@ -155,10 +156,12 @@ displaystatus(Item *item)
 
         putp(tparm(cursor_address, lines-1, 0));
         putp(tparm(enter_standout_mode));
-        n = printf("%3lld%%| %s:%s%s",
+        fmt = (strcmp(item->port, "70") && strcmp(item->port, "gopher")) ?
+              "%3lld%%| %s:%5$s/%c%s" : "%3lld%%| %s/%c%s";
+        n = printf(fmt,
                    (printoff + lines-1 >= nitems) ? 100 :
                    (printoff + lines-1) * 100 / nitems,
-                   item->host, item->port, item->selector);
+                   item->host, item->type, item->selector, item->port);
         putp(tparm(exit_standout_mode));
         printf("%*s", columns-n, " ");