Add some fflushes to make it easier for piped programs to talk to
[u/mdw/putty] / scp.c
diff --git a/scp.c b/scp.c
index 2d02191..ad33413 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -134,12 +134,14 @@ void verify_ssh_host_key(char *host, int port, char *keytype,
         return;
     if (ret == 2) {                    /* key was different */
         fprintf(stderr, wrongmsg, fingerprint);
+       fflush(stderr);
         if (fgets(line, sizeof(line), stdin) &&
             line[0] != '\0' && line[0] != '\n') {
             if (line[0] == 'y' || line[0] == 'Y')
                 store_host_key(host, port, keytype, keystr);
         } else {
             fprintf(stderr, abandoned);
+           fflush(stderr);
             exit(0);
         }
     }