diff mbox series

[BlueZ,v3,3/4] shared/shell: Fix not releasing prompt

Message ID 20230501224410.1119023-3-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 0b88ee29ff1d174fa54d3e462fb0ebc890da3bf4
Headers show
Series [BlueZ,v3,1/4] client/player: Add support for Metadata in BAP Profile | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Luiz Augusto von Dentz May 1, 2023, 10:44 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes not releasing prompt when queueing a line to be executed
since it can be considered as user input if the init script is
attempting to enter it as response to prompt input.
---
 src/shared/shell.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 8b8b253d0bcf..757e16199ddf 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1295,6 +1295,9 @@  static int bt_shell_queue_exec(char *line)
 
 	/* Queue if already executing */
 	if (data.line) {
+		/* Check if prompt is being held then release using the line */
+		if (!bt_shell_release_prompt(line))
+			return 0;
 		queue_push_tail(data.queue, strdup(line));
 		return 0;
 	}