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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user