Been meaning to do this for years: introduce a configuration option
[u/mdw/putty] / raw.c
diff --git a/raw.c b/raw.c
index b4b1108..b2676a9 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -139,6 +139,22 @@ static const char *raw_init(void *frontend_handle, void **backend_handle,
     if ((err = sk_socket_error(raw->s)) != NULL)
        return err;
 
+    if (*cfg->loghost) {
+       char *colon;
+
+       sfree(*realhost);
+       *realhost = dupstr(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;
 }