X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/d947d2b023654d201c1239adc3aee1411523d63b..99a3b3c9a7b45478ce4f279236ebb3c038278f30:/pscp.c diff --git a/pscp.c b/pscp.c index e208157b..3ef1b33d 100644 --- a/pscp.c +++ b/pscp.c @@ -252,8 +252,14 @@ static int ssh_scp_recv(unsigned char *buf, int len) static void ssh_scp_init(void) { while (!back->sendok(backhandle)) { - if (ssh_sftp_loop_iteration() < 0) + if (back->exitcode(backhandle) >= 0) { + errs++; + return; + } + if (ssh_sftp_loop_iteration() < 0) { + errs++; return; /* doom */ + } } /* Work out which backend we ended up using. */ @@ -418,6 +424,7 @@ static void do_cmd(char *host, char *user, char *cmd) cfg.x11_forward = 0; cfg.agentfwd = 0; cfg.portfwd[0] = cfg.portfwd[1] = '\0'; + cfg.ssh_simple = TRUE; /* * Set up main and possibly fallback command depending on @@ -466,7 +473,7 @@ static void do_cmd(char *host, char *user, char *cmd) back->provide_logctx(backhandle, logctx); console_provide_logctx(logctx); ssh_scp_init(); - if (verbose && realhost != NULL) + if (verbose && realhost != NULL && errs == 0) tell_user(stderr, "Connected to %s\n", realhost); sfree(realhost); }