1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Rearrange yes/no prompting code so that the prompts always show the

(possibly (un)translated) letters that are actually expected as input.
Also reject invalid responses instead of silenty taken them as "no".

with help from Bernd Helmle
This commit is contained in:
Peter Eisentraut
2006-09-22 18:50:41 +00:00
parent ae3f415f1d
commit cbb7acface
6 changed files with 34 additions and 38 deletions

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.17 2006/05/29 19:52:46 momjian Exp $
* $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.18 2006/09/22 18:50:41 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -104,11 +104,8 @@ main(int argc, char *argv[])
if (interactive)
{
char *reply;
printf(_("Database \"%s\" will be permanently removed.\n"), dbname);
reply = simple_prompt("Are you sure? (y/n) ", 1, true);
if (check_yesno_response(reply) != 1)
if (!yesno_prompt("Are you sure?"))
exit(0);
}