Browse Source

Flush the remaning chars in the input buffer after reading the
response to the "Overwrite ? [y/N]" question.

Fix the behaviour when the question is asked more than one time.

Originally committed as revision 18036 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini 16 years ago
parent
commit
eab5168cd3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      ffmpeg.c

+ 2 - 0
ffmpeg.c

@@ -3404,6 +3404,8 @@ static void opt_output_file(const char *filename)
                         fprintf(stderr, "Not overwriting - exiting\n");
                         fprintf(stderr, "Not overwriting - exiting\n");
                         av_exit(1);
                         av_exit(1);
                     }
                     }
+                    while (c != '\n' && c != EOF)
+                        c = getchar();
                 }
                 }
                 else {
                 else {
                     fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
                     fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);