diff --git a/src/cryptenroll/cryptenroll-interactive.c b/src/cryptenroll/cryptenroll-interactive.c index c4b8c998bf..f0c1e83789 100644 --- a/src/cryptenroll/cryptenroll-interactive.c +++ b/src/cryptenroll/cryptenroll-interactive.c @@ -151,7 +151,7 @@ static int ask_wipe(EnrollContext *c, unsigned existing_mask) { return log_oom(); bool wipe; - r = prompt_loop_yes_no(question, /* def= */ false, &wipe); + r = prompt_loop_yes_no(question, "no", /* def= */ false, &wipe); if (r < 0) return r; diff --git a/src/shared/prompt-util.c b/src/shared/prompt-util.c index a7bcfe32e3..0a5ab0291b 100644 --- a/src/shared/prompt-util.c +++ b/src/shared/prompt-util.c @@ -217,19 +217,19 @@ static int boolean_is_valid(const char *name, void *userdata) { return parse_boolean(name) >= 0; } -int prompt_loop_yes_no(const char *question, bool def, bool *ret) { +int prompt_loop_yes_no(const char *question, const char *prefill, bool def, bool *ret) { int r; assert(question); assert(ret); - char **l = STRV_MAKE("yes", "no"); + char **menu = STRV_MAKE("yes", "no"); _cleanup_free_ char *reply = NULL; r = prompt_loop(question, GLYPH_WARNING_SIGN, - /* prefill= */ def ? "yes" : "no", - /* menu= */ l, + /* prefill= */ prefill, + /* menu= */ menu, /* accepted= */ NULL, /* ellipsize_percentage= */ 20, /* n_columns= */ 2, diff --git a/src/shared/prompt-util.h b/src/shared/prompt-util.h index 19ab497f08..7c35cb5e58 100644 --- a/src/shared/prompt-util.h +++ b/src/shared/prompt-util.h @@ -26,7 +26,7 @@ int prompt_loop(const char *text, PromptFlags flags, char **ret); -int prompt_loop_yes_no(const char *question, bool def, bool *ret); +int prompt_loop_yes_no(const char *question, const char *prefill, bool def, bool *ret); int chrome_show(const char *top, const char *bottom); void chrome_hide(void); diff --git a/src/sysinstall/sysinstall.c b/src/sysinstall/sysinstall.c index 82232f8ccb..7a531edfcc 100644 --- a/src/sysinstall/sysinstall.c +++ b/src/sysinstall/sysinstall.c @@ -903,6 +903,7 @@ static int prompt_confirm(void) { bool yes; r = prompt_loop_yes_no(arg_summary ? "Please type 'yes' to confirm the choices above and begin the installation" : "Please type 'yes' to begin the installation", + /* prefill= */ NULL, /* def= */ false, &yes); if (r < 0)