X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/96621a840849b4afb6582424d2a1eea08a0be418..d2371c812a1c62b6a258c0717f1fff263cca8ca1:/plink.c diff --git a/plink.c b/plink.c index 76ed437c..6eb9a788 100644 --- a/plink.c +++ b/plink.c @@ -423,8 +423,10 @@ int main(int argc, char **argv) { strncpy(cfg.host, p, sizeof(cfg.host)-1); cfg.host[sizeof(cfg.host)-1] = '\0'; cfg.port = default_port; - } else + } else { cfg = cfg2; + cfg.remote_cmd_ptr = cfg.remote_cmd; + } } else { *r++ = '\0'; strncpy(cfg.username, p, sizeof(cfg.username)-1); @@ -566,11 +568,10 @@ int main(int argc, char **argv) { n = WaitForMultipleObjects(2, handles, FALSE, INFINITE); if (n == 0) { WSANETWORKEVENTS things; - enum234 e; SOCKET socket; - extern SOCKET first_socket(enum234 *), next_socket(enum234 *); + extern SOCKET first_socket(int *), next_socket(int *); extern int select_result(WPARAM, LPARAM); - int i; + int i, socketstate; /* * We must not call select_result() for any socket @@ -580,8 +581,8 @@ int main(int argc, char **argv) { */ /* Count the active sockets. */ i = 0; - for (socket = first_socket(&e); socket != INVALID_SOCKET; - socket = next_socket(&e)) + for (socket = first_socket(&socketstate); socket != INVALID_SOCKET; + socket = next_socket(&socketstate)) i++; /* Expand the buffer if necessary. */ @@ -592,8 +593,8 @@ int main(int argc, char **argv) { /* Retrieve the sockets into sklist. */ skcount = 0; - for (socket = first_socket(&e); socket != INVALID_SOCKET; - socket = next_socket(&e)) { + for (socket = first_socket(&socketstate); socket != INVALID_SOCKET; + socket = next_socket(&socketstate)) { sklist[skcount++] = socket; }