]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Use read_yesno() in opt_output_file().
authorstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 18 Mar 2009 21:38:41 +0000 (21:38 +0000)
committerstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 18 Mar 2009 21:38:41 +0000 (21:38 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18038 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffmpeg.c

index c4f910d1cd6db5d7d7b587f9ae4fbb55de4cfc40..99335f86ed06560dc6e3493f01cd3224eed1a3ac 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3394,18 +3394,13 @@ static void opt_output_file(const char *filename)
              filename[1] == ':' ||
              av_strstart(filename, "file:", NULL))) {
             if (url_exist(filename)) {
-                int c;
-
                 if (!using_stdin) {
                     fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
                     fflush(stderr);
-                    c = getchar();
-                    if (toupper(c) != 'Y') {
+                    if (!read_yesno()) {
                         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);