X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/60860bc3697233687834d4efd4f1fe616f2fb9fb..881da16842e210236b12a040a19bf480de3a5a92:/telnet.c diff --git a/telnet.c b/telnet.c index eeaa76f3..ed685f10 100644 --- a/telnet.c +++ b/telnet.c @@ -805,6 +805,25 @@ static const char *telnet_init(void *frontend_handle, void **backend_handle, */ update_specials_menu(telnet->frontend); + /* + * loghost overrides realhost, if specified. + */ + if (*telnet->cfg.loghost) { + char *colon; + + sfree(*realhost); + *realhost = dupstr(telnet->cfg.loghost); + colon = strrchr(*realhost, ':'); + if (colon) { + /* + * FIXME: if we ever update this aspect of ssh.c for + * IPv6 literal management, this should change in line + * with it. + */ + *colon++ = '\0'; + } + } + return NULL; }