Turned the old `Telnet Command' System-submenu into a more general
[u/mdw/putty] / raw.c
diff --git a/raw.c b/raw.c
index 53a8fc3..10e9ce6 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -181,6 +181,15 @@ static void raw_special(void *handle, Telnet_Special code)
     return;
 }
 
+/*
+ * Return a list of the special codes that make sense in this
+ * protocol.
+ */
+static const struct telnet_special *raw_get_specials(void *handle)
+{
+    return NULL;
+}
+
 static Socket raw_socket(void *handle)
 {
     Raw raw = (Raw) handle;
@@ -217,8 +226,12 @@ static void raw_provide_logctx(void *handle, void *logctx)
 
 static int raw_exitcode(void *handle)
 {
-    /* Exit codes are a meaningless concept in the Raw protocol */
-    return 0;
+    Raw raw = (Raw) handle;
+    if (raw->s != NULL)
+        return -1;                     /* still connected */
+    else
+        /* Exit codes are a meaningless concept in the Raw protocol */
+        return 0;
 }
 
 Backend raw_backend = {
@@ -229,6 +242,7 @@ Backend raw_backend = {
     raw_sendbuffer,
     raw_size,
     raw_special,
+    raw_get_specials,
     raw_socket,
     raw_exitcode,
     raw_sendok,