telnet/tn3270: don't use @ if username is empty - gopherproxy-c - Gopher HTTP proxy in C (CGI)
(HTM) git clone git://git.codemadness.org/gopherproxy-c
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 0c008b2c7e67000e28de30bb3fc85b956a7645e0
(DIR) parent 9890cde16cba2a03048800bfd81919b0bf9f0e5c
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 17 Aug 2018 16:08:59 +0200
telnet/tn3270: don't use @ if username is empty
Diffstat:
M gopherproxy.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/gopherproxy.c b/gopherproxy.c
@@ -333,8 +333,10 @@ servedir(const char *server, const char *port, const char *path, const char *par
case 'T': /* tn3270 */
fputs(typestr(v._type), stdout);
printf(" <a href=\"%s://", v._type == '8' ? "telnet" : "tn3270");
- xmlencode(v.path);
- fputs("@", stdout);
+ if (v.path[0]) {
+ xmlencode(v.path);
+ fputs("@", stdout);
+ }
xmlencode(v.server);
fputs(":", stdout);
xmlencode(v.port);