From dd322c686c8902a0fa8b2f86bf3e57dc2a3f09ad Mon Sep 17 00:00:00 2001 From: stefano Date: Wed, 18 Mar 2009 21:34:19 +0000 Subject: [PATCH] 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. git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18036 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- ffmpeg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index 57770e630..c4f910d1c 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3404,6 +3404,8 @@ static void opt_output_file(const char *filename) fprintf(stderr, "Not overwriting - exiting\n"); av_exit(1); } + while (c != '\n' && c != EOF) + c = getchar(); } else { fprintf(stderr,"File '%s' already exists. Exiting.\n", filename); -- 2.39.2