Merge Debian's patch 466_fflush-prompt

* libmisc/Makefile.am, lib/prototypes.h, libmisc/yesno.c, src/grpck.c,
	src/pwck.c: move yes_or_no() from grpck/pwck to a separate
	libmisc/yesno.c (with a read_only argument).
	* libmisc/fields.c, libmisc/yesno.c: Make sure stdout is flushed before
	reading the user's answer.
This commit is contained in:
nekral-guest
2007-12-26 16:50:38 +00:00
parent e663c696c2
commit fd970ab62c
7 changed files with 105 additions and 67 deletions

View File

@ -71,6 +71,7 @@ void change_field (char *buf, size_t maxsize, const char *prompt)
maxsize = sizeof (newf);
printf ("\t%s [%s]: ", prompt, buf);
fflush (stdout);
if (fgets (newf, maxsize, stdin) != newf)
return;