When we get an error writing to a local file, stop the download rather than
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Tue, 10 Apr 2007 21:46:44 +0000 (21:46 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Tue, 10 Apr 2007 21:46:44 +0000 (21:46 +0000)
pretending we just got -1 bytes.  Not actually tested, but it looks pretty
obvious.
Bug reported by dking wang.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7459 cda61777-01e9-0310-a592-d414129be87e

psftp.c

diff --git a/psftp.c b/psftp.c
index f8a2240..e41112a 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -463,6 +463,7 @@ int sftp_get_file(char *fname, char *outfname, int recurse, int restart)
                    printf("error while writing local file\n");
                    ret = 0;
                    xfer_set_error(xfer);
+                   break;
                }
                wpos += wlen;
            }