]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Replicate r8110 from PSFTP to PSCP, and various other minor patchery from
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Fri, 11 Jul 2008 19:24:56 +0000 (19:24 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Fri, 11 Jul 2008 19:24:56 +0000 (19:24 +0000)
Roger Picton.

[originally from svn r8117]
[r8110 == e01df1da9f41aa7554e99708c117241c59fcef3d]

pscp.c

diff --git a/pscp.c b/pscp.c
index 1809c6f7a0f78d23caf81076d964a72b9358485e..3ef1b33d89e5151accbefd8fdc5cea5adf2508c4 100644 (file)
--- 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);
 }