All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez PATCH] shared/shell: don't allow completion fallback
@ 2021-09-03 14:01 Alain Michaud
  2021-09-03 14:33 ` [Bluez] " bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Alain Michaud @ 2021-09-03 14:01 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz; +Cc: Alain Michaud

When using bluetoothctl, if the user enters a quotation mark before
pressing tab, the completion handler falls back to the shell's handler
which ends up printing the current folder's file content.  This behavior
is never desired in bt_shell's menu.

This was verified by typing " then tab-tab before and after the change as
been made to confirm the desired behavior and verified that all other
argument completions (such as address completion) continues to function.

---

 src/shared/shell.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 21e8b50cd..cbb9b8b88 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -903,6 +903,8 @@ static char **shell_completion(const char *text, int start, int end)
 {
 	char **matches = NULL;
 
+	rl_attempted_completion_over = 1;
+
 	if (!data.menu)
 		return NULL;
 
@@ -925,9 +927,6 @@ static char **shell_completion(const char *text, int start, int end)
 		matches = rl_completion_matches(text, cmd_generator);
 	}
 
-	if (!matches)
-		rl_attempted_completion_over = 1;
-
 	return matches;
 }
 
-- 
2.33.0.153.gba50c8fa24-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-04  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03 14:01 [Bluez PATCH] shared/shell: don't allow completion fallback Alain Michaud
2021-09-03 14:33 ` [Bluez] " bluez.test.bot
2021-09-04  0:33   ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.