From: senhuang42 Date: Wed, 26 Aug 2020 15:57:38 +0000 (-0400) Subject: Fix bug in user prompt where line was not flushed on negative response X-Git-Tag: v1.4.7~90^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fed7e7850bcc3267f5fbda167c0281d48b91758f;p=thirdparty%2Fzstd.git Fix bug in user prompt where line was not flushed on negative response --- diff --git a/programs/fileio.c b/programs/fileio.c index 29b499b4b..e4c958487 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -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 */