diff mbox series

[Bluez] shared/shell: don't allow completion fallback

Message ID 20210903140118.3469656-1-alainm@chromium.org
State New
Headers show
Series [Bluez] shared/shell: don't allow completion fallback | expand

Commit Message

Alain Michaud Sept. 3, 2021, 2:01 p.m. UTC
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(-)

Comments

Luiz Augusto von Dentz Sept. 4, 2021, 12:33 a.m. UTC | #1
Hi Alain,

On Fri, Sep 3, 2021 at 7:37 AM <bluez.test.bot@gmail.com> wrote:
>

> This is automated email and please do not reply to this email!

>

> Dear submitter,

>

> Thank you for submitting the patches to the linux bluetooth mailing list.

> This is a CI test results with your patch series:

> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=541783

>

> ---Test result---

>

> Test Summary:

> CheckPatch                    PASS      0.27 seconds

> GitLint                       PASS      0.12 seconds

> Prep - Setup ELL              PASS      40.85 seconds

> Build - Prep                  PASS      0.10 seconds

> Build - Configure             PASS      7.13 seconds

> Build - Make                  PASS      177.53 seconds

> Make Check                    PASS      8.82 seconds

> Make Distcheck                PASS      211.31 seconds

> Build w/ext ELL - Configure   PASS      7.27 seconds

> Build w/ext ELL - Make        PASS      169.16 seconds

>

> Details

> ##############################

> Test: CheckPatch - PASS

> Desc: Run checkpatch.pl script with rule in .checkpatch.conf

>

> ##############################

> Test: GitLint - PASS

> Desc: Run gitlint with rule in .gitlint

>

> ##############################

> Test: Prep - Setup ELL - PASS

> Desc: Clone, build, and install ELL

>

> ##############################

> Test: Build - Prep - PASS

> Desc: Prepare environment for build

>

> ##############################

> Test: Build - Configure - PASS

> Desc: Configure the BlueZ source tree

>

> ##############################

> Test: Build - Make - PASS

> Desc: Build the BlueZ source tree

>

> ##############################

> Test: Make Check - PASS

> Desc: Run 'make check'

>

> ##############################

> Test: Make Distcheck - PASS

> Desc: Run distcheck to check the distribution

>

> ##############################

> Test: Build w/ext ELL - Configure - PASS

> Desc: Configure BlueZ source with '--enable-external-ell' configuration

>

> ##############################

> Test: Build w/ext ELL - Make - PASS

> Desc: Build BlueZ source with '--enable-external-ell' configuration

>

>

>

> ---

> Regards,

> Linux Bluetooth


Applied, thanks.

-- 
Luiz Augusto von Dentz
diff mbox series

Patch

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;
 }