From deae158e2bac8971d1dd5573f0aa4af968b21e35 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 23 Feb 2018 14:07:25 +0200 Subject: [PATCH] shared/shell: Disable bt_shell_prompt_input in noninteractive mode Only the input given as argument shall be processed, all the rest shall be ignored. --- src/shared/shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/shell.c b/src/shared/shell.c index 3aabda7bf..b4e64365a 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -429,6 +429,9 @@ void bt_shell_hexdump(const unsigned char *buf, size_t len) void bt_shell_prompt_input(const char *label, const char *msg, bt_shell_prompt_input_func func, void *user_data) { + if (!data.init || data.mode) + return; + /* Normal use should not prompt for user input to the value a second * time before it releases the prompt, but we take a safe action. */ if (data.saved_prompt) -- 2.47.3