| 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:
M sacc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- |
| @@ -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); |