Re: [PATCH 7/7] builtin-merge: avoid non-strategy git-merge commands in error message
- From
Miklos Vajna <vmiklos@frugalware.org>
- Date
- Jul 26, 2008, 16:00 UTC
- Message-ID
- <20080726160022.GM32057@genesis.frugalware.org>
- In-Reply-To
- <alpine.DEB.1.00.0807261737260.26810@eeepc-johanness>
On Sat, Jul 26, 2008 at 05:38:55PM +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 5 quoted lines
> > - if (!strcmp(main_cmds.names[i]->name, all_strategy[j].name)) > > + if (!strncmp(ent->name, all_strategy[j].name, ent->len)) > > Oops... that is not what I meant. You'd have to check if > !all_strategy[j].name[ent->len], too...
Hmm. So let's say ent->name is "ours.exe", ent->len is set to 4.
Then !strncmp(ent->name, all_strategy[j].name, ent->len) will be true, and the command will not be added to the exclude list.
However, if I check for !all_strategy[j].name[ent->len], that will be false, so 'ours' will be excluded from the available strategy list.
Have I missed something?
Thanks.