git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] show-branch: fix segfault when showbranch.default exists

From
Stephen Boyd <bebarino@gmail.com>
Date
Jun 9, 2009, 07:17 UTC
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.

Previous: Junio C HamanoNext: Pierre Habouzit
Message 2 of 12 in “show-branch: fix segfault when showbranch.default exists”
  1. show-branch: fix segfault when showbranch.default existsJunio C Hamano, Jun 9, 2009
  2. Stephen BoydJun 9, 2009
  3. Pierre HabouzitJun 9, 2009
  4. Junio C HamanoJun 9, 2009
  5. Pierre HabouzitJun 9, 2009
  6. branch managementHarry Duin, Jun 9, 2009
  7. Alex RiesenJun 9, 2009
  8. Harry DuinJun 10, 2009
  9. Jakub NarebskiJun 10, 2009
  10. Nicolas PitreJun 10, 2009
  11. Linus TorvaldsJun 10, 2009
  12. Daniel BarkalowJun 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.