]> git.ipfire.org Git - thirdparty/git.git/commit
completion: fix multiple command removals
authorJeff King <peff@peff.net>
Wed, 20 Mar 2019 18:03:28 +0000 (14:03 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Mar 2019 02:52:11 +0000 (11:52 +0900)
commit057ab54b6646fbdabc8c953299f218081ff67456
treef04384200663b1ef50f251c5588459bbbd6aa830
parent402e3e1500b3bce5cee9f903f8aa691a8010e76a
completion: fix multiple command removals

Commit 6532f3740b ("completion: allow to customize the completable
command list", 2018-05-20) tried to allow multiple space-separated
entries in completion.commands. To do this, it copies each parsed token
into a strbuf so that the result is NUL-terminated.

However, for tokens starting with "-", it accidentally passes the
original non-terminated string, meaning that only the final one worked.
Switch to using the strbuf.

Reported-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
help.c
t/t9902-completion.sh