X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/2e528220e71dea5e16fcc877e061f983ab2d837e..d0370c96527b48387a0fb0fbf5ccc8b9d8cc6458:/pscp.c diff --git a/pscp.c b/pscp.c index 1809c6f7..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. */ @@ -467,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); }