From: Stephen Boyd Date: Tue, 09 Jun 2009 07:17:28 GMT Subject: Re: [PATCH] show-branch: fix segfault when showbranch.default exists Message-ID: <4A2E0C88.70805@gmail.com> In-Reply-To: <7vfxe9udln.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > I am not sure if this is a bug in parse_options(), or a bug in the caller, > and tonight I do not have enough concentration to figure out which. In > any case, this patch works the issue around. I am low on concentration tonight as well, but this looks right to me. Parse options is expecting the regular old argv and argc. I overlooked this code path during the conversion (though I remember figuring out what this path was doing). Faking the argv and argc a little more accurately, like you do, should work fine. On a side note, I can't remember why I used PARSE_OPT_STOP_AT_NON_OPTION. I think it should be 0.