1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

common: Add cpr_get_answer_is_yes_def()

* g10/cpr.c (cpr_get_answer_is_yes): Factor code out to ....
(cpr_get_answer_is_yes_def): ...new.
This commit is contained in:
Werner Koch 2014-07-23 14:35:22 +02:00
parent 17404b2fcc
commit 75127bc456
2 changed files with 10 additions and 2 deletions

View File

@ -493,7 +493,7 @@ cpr_kill_prompt(void)
}
int
cpr_get_answer_is_yes( const char *keyword, const char *prompt )
cpr_get_answer_is_yes_def (const char *keyword, const char *prompt, int def_yes)
{
int yes;
char *p;
@ -509,13 +509,19 @@ cpr_get_answer_is_yes( const char *keyword, const char *prompt )
}
else {
tty_kill_prompt();
yes = answer_is_yes(p);
yes = answer_is_yes_no_default (p, def_yes);
xfree(p);
return yes;
}
}
}
int
cpr_get_answer_is_yes (const char *keyword, const char *prompt)
{
return cpr_get_answer_is_yes_def (keyword, prompt, 0);
}
int
cpr_get_answer_yes_no_quit( const char *keyword, const char *prompt )
{

View File

@ -191,6 +191,8 @@ char *cpr_get_no_help( const char *keyword, const char *prompt );
char *cpr_get_utf8( const char *keyword, const char *prompt );
char *cpr_get_hidden( const char *keyword, const char *prompt );
void cpr_kill_prompt(void);
int cpr_get_answer_is_yes_def (const char *keyword, const char *prompt,
int def_yes);
int cpr_get_answer_is_yes( const char *keyword, const char *prompt );
int cpr_get_answer_yes_no_quit( const char *keyword, const char *prompt );
int cpr_get_answer_okay_cancel (const char *keyword,