sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit 551de298348c406d14ab8f2787cfeabbeb89bd6e
parent b9d624f390dec6bfa114e5c46292ab2ee4e0ece7
Author: Quentin Rameau <quinq@fifth.space>
Date:   Sat, 24 Feb 2018 12:51:58 +0100

Re-style previous patch b9d624f

Diffstat:
sacc.c | 18++++++++----------
ui_ti.c | 4++--
ui_txt.c | 4++--
3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/sacc.c b/sacc.c @@ -619,19 +619,10 @@ dig(Item *entry, Item *item) case '9': downloaditem(item); return 0; - case 'T': - if (asprintf(&plumburi, "tn3270://%s@%s:%s", item->selector, - item->host, item->port) < 0) { - return 0; - } - plumb(plumburi); - free(plumburi); - return 0; case '8': if (asprintf(&plumburi, "telnet://%s@%s:%s", item->selector, - item->host, item->port) < 0) { + item->host, item->port) < 0) return 0; - } plumb(plumburi); free(plumburi); return 0; @@ -640,6 +631,13 @@ dig(Item *entry, Item *item) case 'I': plumbitem(item); return 0; + case 'T': + if (asprintf(&plumburi, "tn3270://%s@%s:%s", item->selector, + item->host, item->port) < 0) + return 0; + plumb(plumburi); + free(plumburi); + return 0; default: uistatus("Type %c (%s) not supported", item->type, typedisplay(item->type)); diff --git a/ui_ti.c b/ui_ti.c @@ -210,7 +210,7 @@ displayuri(Item *item) switch (item->type) { case '8': n = snprintf(bufout, sizeof(bufout), "telnet://%s@%s:%s", - item->selector, item->host, item->port); + item->selector, item->host, item->port); break; case 'h': n = snprintf(bufout, sizeof(bufout), "%s: %s", @@ -218,7 +218,7 @@ displayuri(Item *item) break; case 'T': n = snprintf(bufout, sizeof(bufout), "tn3270://%s@%s:%s", - item->selector, item->host, item->port); + item->selector, item->host, item->port); break; default: fmt = strcmp(item->port, "70") ? diff --git a/ui_txt.c b/ui_txt.c @@ -183,7 +183,7 @@ printuri(Item *item, size_t i) return; case '8': n = snprintf(bufout, sizeof(bufout), "telnet://%s@%s:%s", - item->selector, item->host, item->port); + item->selector, item->host, item->port); break; case 'i': n = snprintf(bufout, sizeof(bufout), "%zu: %s", @@ -195,7 +195,7 @@ printuri(Item *item, size_t i) break; case 'T': n = snprintf(bufout, sizeof(bufout), "tn3270://%s@%s:%s", - item->selector, item->host, item->port); + item->selector, item->host, item->port); break; default: fmt = strcmp(item->port, "70") ?