Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp510151pxb; Fri, 3 Sep 2021 07:06:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN3dDSozVVG4nY0kBIxNE1t4dhcykG56kYeWs2/iTpdjNcx+pYAc/U4QnLnrTal6jC0t1K X-Received: by 2002:a17:906:2ad5:: with SMTP id m21mr4430456eje.88.1630677993969; Fri, 03 Sep 2021 07:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630677993; cv=none; d=google.com; s=arc-20160816; b=sxUmTyez9eyZZHSKIS2c8yEHaRRIeuMWcaV5x3+9V3te4F7n5ztcFGyw6YEGp+7Ump SX+zUj5BVsGPHPK/mSH99V+ngvewBxP9R8zXydnbOZxkHQdEThLJUe98Svn8U+eYhU91 P2WibLAhN54LBx2dN9mTNxE6thQEA4geK18uu2f+JDv3h2xcjYrOb+nGQYGQOU3Mkvxn ORErdJ39ONZJblitoeGk7eU3Ndbt9F9yB0Xy5CSO3Hbxa4oDtfedHlrNUzb+VBhmfjpP 9soROIntlg/DmwH9F1ZixBZFUzLe75vdDE5r1PCpJ31B30TZ3GTRAKtn9esQHJZ52BXO Hrlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jLr4l/e2yUPIFPLD6Z6dbCgxggzYg1YohgRbf0t5c1Q=; b=PWJW2beGUQo1U0b0lQrIDser4Cedu2/T91zfcY4p3lyLOAmdDKHpdrMpwmVJBhPvNl DAy36fywGH6Xfxbg2V2JBF3/JcOmM4+RQRqWchnZoD9deHxkfMIdZuvePZsJaTC47lCh Q95f7nKyJP6q3dflabP3stteQYkMoZPXUbOOI2XvcpMaQpjc0e/NWS8vFPUEDyeBU6O9 hgXs8IlnEiVTGWv7QBIXcvcdLxnP+LyuaU+nV7J50Y8VDyEpq3OGjN/R5jqcgXzvowbp DtzjoDz/6FfhiB3ReLHFIkt8D/0v91aqr/V4258WiMVSfoQ6z3MKzK1JoaNaQhNAvJLt jYhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FPCXac0G; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si5091500ejz.748.2021.09.03.07.05.33; Fri, 03 Sep 2021 07:06:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FPCXac0G; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235554AbhICOCg (ORCPT + 99 others); Fri, 3 Sep 2021 10:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbhICOCc (ORCPT ); Fri, 3 Sep 2021 10:02:32 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E53F9C061575 for ; Fri, 3 Sep 2021 07:01:30 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id a21so4422957vsp.12 for ; Fri, 03 Sep 2021 07:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jLr4l/e2yUPIFPLD6Z6dbCgxggzYg1YohgRbf0t5c1Q=; b=FPCXac0G4iMq3UvtOJtr60EL6ra8Ez/piRMpGFVdtBwB6RIXJ3rPYO7II1jfEg/s1y oZMWXV1e4X0uSdad349v2QNi+SeROGLZ62uPQa3XgZfVdfYOwdbCHbTAa5PSbVafdp7l 0X2T+1YlifXHVTJftjsvPM3qclhT2mZOqmPnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jLr4l/e2yUPIFPLD6Z6dbCgxggzYg1YohgRbf0t5c1Q=; b=Q00oIWtectFLHGFIDL+WagjwCvrZ5H3IwHIh8czIr1S9OTp+K29Ng09pfK2+b5Uzn/ uOwXCGl9eClr7SE1myZ+2hMCdWInZLo9NfeXC2DEHmrWpMM/PtArUEY/fTPxyxLKi9Lo jTS9m0+pYouIzdGvBF5VrqWeZDYWssMrKvFWityy+FnQ7KfumADoPw80Wj/lixb33hmI hVfQfD0eL8CbZv8jexXvsmxIros4H6hBAn6Wl5FL1KpoqZH7yuF1G+CKM09U0CERDQJD a+TanwSD8yphtkVoSV6SUQRjq8ugO7GDvvKYz5OK9Merzw4TJlGfspxj0bXa4tlChf4Z 4hLg== X-Gm-Message-State: AOAM530TBFiX9VBQiaF+lzNmfZdMu/9oWkr+rt8pD17tTPICeE/oDFbU cGmJHG1+SnzsgXWFOz/ozQTRMI5T4V6Ysj5H X-Received: by 2002:a67:24c6:: with SMTP id k189mr2695299vsk.3.1630677689781; Fri, 03 Sep 2021 07:01:29 -0700 (PDT) Received: from alain.c.googlers.com.com (39.119.74.34.bc.googleusercontent.com. [34.74.119.39]) by smtp.gmail.com with ESMTPSA id s46sm506583uad.20.2021.09.03.07.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 07:01:29 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: Alain Michaud Subject: [Bluez PATCH] shared/shell: don't allow completion fallback Date: Fri, 3 Sep 2021 14:01:18 +0000 Message-Id: <20210903140118.3469656-1-alainm@chromium.org> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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