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:
parent
17404b2fcc
commit
75127bc456
10
g10/cpr.c
10
g10/cpr.c
@ -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 )
|
||||
{
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user