Re: [PATCH 1/2] rebase -i: match whole word in is_command()
- From
Jeff King <peff@peff.net>
- Date
- Feb 26, 2023, 10:29 UTC
- Message-ID
- <Y/s0iV5cS9fJ2ONl@coredump.intra.peff.net>
- In-Reply-To
- <b050e7c1a4daf6c65aa9b2b6f44248d7b403918e.1677185702.git.gitgitgadget@gmail.com>
On Thu, Feb 23, 2023 at 08:55:00PM +0000, Phillip Wood via GitGitGadget wrote:
Show 6 quoted lines
> Fix this by ensuring the match is follow by whitespace or the end of the > string as we already do for abbreviated commands. The (*bol = p) at the > end of the condition is a bit cute for my taste but I decided to leave > it be for now. Rather than add new tests the existing tests for bad > commands are adapted to use a bad command name that triggers the prefix > matching bug.
FWIW, coverity complained about the (*bol = p) assignment in the conditional, since "p" must be non-NULL at this point.
So this is email is a combination of:
- a data point that it is not just you that finds it a bit cute (in
case you do want to change it later); and - a hearty thank you for mentioning it in the commit message, since
just looking at the code left me scratching my head at whether this
was a bug.-Peff