Trim trailing whitespace off saved session names on the command line
[u/mdw/putty] / plink.c
diff --git a/plink.c b/plink.c
index 89b2f2c..bee734f 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -11,6 +11,7 @@
 
 #define PUTTY_DO_GLOBALS                      /* actually _define_ globals */
 #include "putty.h"
+#include "winstuff.h"
 #include "storage.h"
 
 void fatalbox (char *p, ...) {
@@ -511,6 +512,8 @@ int main(int argc, char **argv) {
                 back->special(TS_EOF);
             }
         }
+        if (back->socket() == INVALID_SOCKET)
+            break;                 /* we closed the connection */
     }
     WSACleanup();
     return 0;