Re: [PATCH] help: Add a missing OPT_END().
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 2, 2008, 04:34 UTC
- Message-ID
- <7vk5jgan9e.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080402034430.GA10360@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> On Wed, Apr 02, 2008 at 05:47:41AM +0200, Christian Couder wrote: > >> Some comments in "parse-options.h" say it is needed, >> though I did not see a crash without it. > > There was no particular reason I didn't put it in; I just didn't know > about it. So ack from me, assuming it is supposed to be there.
parse-options.c::parse_short_opt() and parse_long_opt() has this loop:
for (; options->type != OPTION_END; options++) {
...
}So whatever happens to come after builtin_help_options[] may be read from by this loop when you do not have OPTION_END.