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

Re: [PATCH] grep: correctly initialize help-all option

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 9, 2015, 19:45 UTC
Message-ID
<CAPig+cQQVO0RqZrAkLxS3v-iPf4LFsDOVz_fPDhofvLvs7tFyA@mail.gmail.com>
In-Reply-To
<1428586916-22679-1-git-send-email-ps@pks.im>
On Thu, Apr 9, 2015 at 9:41 AM, Patrick Steinhardt <ps@pks.im> wrote:
> The "help-all" option is being initialized with a wrong value.
> While being semantically wrong this can also cause a gcc
> segmentation fault on ARMv7 hardfloat platforms with a hardened
> toolchain. Fix this by initializing with the correct value.
Missing sign-off.
Show 11 quoted lines
> ---
> diff --git a/builtin/grep.c b/builtin/grep.c
> index abc4400..c0bf005 100644
> --- a/builtin/grep.c
> +++ b/builtin/grep.c
> @@ -738,7 +738,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
>                         PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
>                 OPT_BOOL(0, "ext-grep", &external_grep_allowed__ignored,
>                          N_("allow calling of grep(1) (ignored by this build)")),
> -               { OPTION_CALLBACK, 0, "help-all", &options, NULL, N_("show usage"),
> +               { OPTION_CALLBACK, 0, "help-all", &opt, NULL, N_("show usage"),
This dates back to 3e230fa1 (grep: use parseopt; 2009-05-07).
builtin/show-ref.c just passes NULL for that argument in the same situation.
Show 5 quoted lines
>                   PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },
>                 OPT_END()
>         };
> --
> 2.3.5
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 2 of 8 in “grep: correctly initialize help-all option”
  1. grep: correctly initialize help-all optionPatrick Steinhardt, Apr 9, 2015
  2. Eric SunshineApr 9, 2015
  3. grep: correctly initialize help-all optionPatrick Steinhardt, Apr 9, 2015
  4. René ScharfeApr 10, 2015
  5. René ScharfeApr 9, 2015
  6. Patrick SteinhardtApr 10, 2015
  7. René ScharfeApr 10, 2015
  8. Patrick SteinhardtApr 11, 2015

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.