sacc

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

commit bab7585c38f70040c68865455e3fafa552cf9f6c
parent cffc2d4ac776d81b9e8a8083cee8064cd3f0d954
Author: Quentin Rameau <quinq@fifth.space>
Date:   Sat, 18 Aug 2018 14:51:58 +0200

Do not put a username in telnets urls when the field is empty

Thanks to Hiltjo for the hint!

Diffstat:
sacc.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sacc.c b/sacc.c @@ -679,14 +679,16 @@ dig(Item *entry, Item *item) downloaditem(item); return 0; case '8': - if (asprintf(&plumburi, "telnet://%s@%s:%s", item->selector, + if (asprintf(&plumburi, "telnet://%s%s%s:%s", + item->selector, item->selector ? "@" : "", item->host, item->port) < 0) return 0; plumb(plumburi); free(plumburi); return 0; case 'T': - if (asprintf(&plumburi, "tn3270://%s@%s:%s", item->selector, + if (asprintf(&plumburi, "tn3270://%s%s%s:%s", + item->selector, item->selector ? "@" : "", item->host, item->port) < 0) return 0; plumb(plumburi);