On cleanup, PSCP and PSFTP should explicitly check that the back end
[u/mdw/putty] / pscp.c
diff --git a/pscp.c b/pscp.c
index a906303..5f22828 100644 (file)
--- a/pscp.c
+++ b/pscp.c
@@ -245,7 +245,7 @@ static int ssh_scp_recv(unsigned char *buf, int len)
     }
 
     while (outlen > 0) {
-       if (ssh_sftp_loop_iteration() < 0)
+       if (back->exitcode(backhandle) >= 0 || ssh_sftp_loop_iteration() < 0)
            return 0;                  /* doom */
     }