Commit b403de42 authored by Niels Möller's avatar Niels Möller
Browse files

(interact_yes_or_no): Deleted argument free.

Use werror_quiet_p and return default answer in quiet mode.
Updated callers.

Rev: src/interact.h:1.17
Rev: src/unix_interact.c:1.32
parent d7238aad
......@@ -67,7 +67,7 @@ void
interact_set_askpass(const char *askpass);
int
interact_yes_or_no(const struct lsh_string *prompt, int def, int free);
interact_yes_or_no(const struct lsh_string *prompt, int def);
struct lsh_string *
interact_read_password(const struct lsh_string *prompt);
......
......@@ -240,15 +240,15 @@ read_line(uint32_t size, uint8_t *buffer)
#undef BUFSIZE
}
/* Consumes prompt string. */
int
interact_yes_or_no(const struct lsh_string *prompt, int def, int free)
interact_yes_or_no(const struct lsh_string *prompt, int def)
{
#define TTY_BUFSIZE 10
if (!IS_TTY())
if (!IS_TTY() || werror_quiet_p())
{
if (free)
lsh_string_free(prompt);
lsh_string_free(prompt);
return def;
}
else
......@@ -259,8 +259,7 @@ interact_yes_or_no(const struct lsh_string *prompt, int def, int free)
res = write_raw(tty_fd, STRING_LD(prompt));
if (free)
lsh_string_free(prompt);
lsh_string_free(prompt);
if (!res)
return def;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment