]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix bug in user prompt where line was not flushed on negative response
authorsenhuang42 <senhuang96@fb.com>
Wed, 26 Aug 2020 15:57:38 +0000 (11:57 -0400)
committersenhuang42 <senhuang96@fb.com>
Wed, 26 Aug 2020 15:57:38 +0000 (11:57 -0400)
programs/fileio.c

index 29b499b4b9276450258db04d624418255aa66c74..e4c9584871b4ea850ca7db27d1386a09fce880ab 100644 (file)
@@ -624,9 +624,10 @@ FIO_openDstFile(FIO_prefs_t* const prefs,
                 {   int ch = getchar();
                     if ((ch!='Y') && (ch!='y')) {
                         DISPLAY("    not overwritten  \n");
+                        /* flush rest of input line */
+                        while ((ch!=EOF) && (ch!='\n')) ch = getchar();
                         return NULL;
                     }
-                    /* flush rest of input line */
                     while ((ch!=EOF) && (ch!='\n')) ch = getchar();
             }   }
             /* need to unlink */