From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28109 invoked by alias); 28 Jun 2019 14:56:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28095 invoked by uid 89); 28 Jun 2019 14:56:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*Ad:U*palves X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Jun 2019 14:56:25 +0000 Received: by mail-wr1-f68.google.com with SMTP id c2so6615029wrm.8 for ; Fri, 28 Jun 2019 07:56:24 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id o6sm2556905wmc.46.2019.06.28.07.56.22 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 07:56:22 -0700 (PDT) Subject: Re: [PATCH 4/5] Fix latent bug in test_gdb_complete_cmd_multiple To: Tom Tromey References: <20190627191427.20742-1-palves@redhat.com> <20190627191427.20742-5-palves@redhat.com> <871rzd223d.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <53a1cc84-3d75-f074-8ddd-862dd07343b2@redhat.com> Date: Fri, 28 Jun 2019 14:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <871rzd223d.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00631.txt.bz2 On 6/28/19 3:53 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> if {$max_completions} { > Pedro> + set cmd_prefix_re [string_to_regexp $cmd_prefix] > Pedro> append expected_re \ > Pedro> - "$cmd_prefix \\*\\*\\* List may be truncated, max-completions reached\\. \\*\\*\\*.*\r\n" > Pedro> + "$cmd_prefix_re \\*\\*\\* List may be truncated, max-completions reached\\. \\*\\*\\*.*\r\n" > Pedro> } > > Pedro> set cmd_re [string_to_regexp "complete $cmd_prefix$completion_word"] > > It looks like this is going to end up running string_to_regexp twice -- > once in the "if" and then again here, which is probably not desirable. It won't because the second time is still referring to $cmd_prefix, while the new code introduces a new $cmd_prefix_re variable. Thanks, Pedro Alves