Remove an unused variable (should shut up a warning from GCC 4.6).
[sgt/putty] / raw.c
diff --git a/raw.c b/raw.c
index 31d7490..b2676a9 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -1,3 +1,7 @@
+/*
+ * "Raw" backend.
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -135,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;
 }
 
@@ -205,10 +225,10 @@ static const struct telnet_special *raw_get_specials(void *handle)
     return NULL;
 }
 
-static Socket raw_socket(void *handle)
+static int raw_connected(void *handle)
 {
     Raw raw = (Raw) handle;
-    return raw->s;
+    return raw->s != NULL;
 }
 
 static int raw_sendok(void *handle)
@@ -266,7 +286,7 @@ Backend raw_backend = {
     raw_size,
     raw_special,
     raw_get_specials,
-    raw_socket,
+    raw_connected,
     raw_exitcode,
     raw_sendok,
     raw_ldisc,
@@ -274,5 +294,7 @@ Backend raw_backend = {
     raw_provide_logctx,
     raw_unthrottle,
     raw_cfg_info,
-    1
+    "raw",
+    PROT_RAW,
+    0
 };