On cleanup, PSCP and PSFTP should explicitly check that the back end
[u/mdw/putty] / psftp.c
diff --git a/psftp.c b/psftp.c
index 2a74bcd..db3ae7f 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -2567,7 +2567,7 @@ int sftp_recvdata(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 */
     }