From fed7e7850bcc3267f5fbda167c0281d48b91758f Mon Sep 17 00:00:00 2001 From: senhuang42 Date: Wed, 26 Aug 2020 11:57:38 -0400 Subject: [PATCH] Fix bug in user prompt where line was not flushed on negative response --- programs/fileio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */