This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 4/5] Fix latent bug in test_gdb_complete_cmd_multiple
On 6/28/19 3:53 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> 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