diff options
author | Werner Koch <wk@gnupg.org> | 2014-07-23 14:35:22 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-07-23 14:35:22 +0200 |
commit | 75127bc4561787aa9bc1cf976658e20192446d7f (patch) | |
tree | e789993d0c001a658f781587e4061421704b202c /g10/cpr.c | |
parent | gpg: Make --quick-sign-key promote local key signatures. (diff) | |
download | gnupg2-75127bc4561787aa9bc1cf976658e20192446d7f.tar.xz gnupg2-75127bc4561787aa9bc1cf976658e20192446d7f.zip |
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.
Diffstat (limited to 'g10/cpr.c')
-rw-r--r-- | g10/cpr.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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,7 +509,7 @@ 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; } @@ -517,6 +517,12 @@ cpr_get_answer_is_yes( const char *keyword, const char *prompt ) } 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 ) { int yes; |