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

Re: [PATCH] OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODE

From
孙赫 <sunheehnus@gmail.com>
Date
Feb 28, 2014, 14:32 UTC
Message-ID
<CAJr59C1qHrQ9qPdDWfGzj9QX3L-EwEcP+updu0SDn24r4i7UMQ@mail.gmail.com>
In-Reply-To
<1393597765-14164-1-git-send-email-sunheehnus@gmail.com>

I am not sure if this is a bug. I need your help to find out it.

Cheers, He Sun

2014-02-28 22:29 GMT+08:00 Sun He <sunheehnus@gmail.com>:
Show 26 quoted lines
> Signed-off-by: Sun He <sunheehnus@gmail.com>
> ---
>  parse-options.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/parse-options.c b/parse-options.c
> index 7b8d3fa..59a52b0 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -371,7 +371,7 @@ static void parse_options_check(const struct option *opts)
>                 case OPTION_NEGBIT:
>                 case OPTION_SET_INT:
>                 case OPTION_SET_PTR:
> -               case OPTION_NUMBER:
> +               case OPTION_CMDMODE:
>                         if ((opts->flags & PARSE_OPT_OPTARG) ||
>                             !(opts->flags & PARSE_OPT_NOARG))
>                                 err |= optbug(opts, "should not accept an argument");
> --
> 1.9.0.138.g2de3478.dirty
> ---
> I came across this protential bug.
> According to parse-options.h OPTION_CMDMODE is an option with noarguments and OPTION_NUMBER is special type option.
>
> Thanks,
> He Sun
Previous: Sun HeNext: Duy Nguyen
Message 2 of 6 in “OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODE”
  1. OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODESun He, Feb 28, 2014
  2. 孙赫Feb 28, 2014
  3. Duy NguyenFeb 28, 2014
  4. 孙赫Feb 28, 2014
  5. Junio C HamanoFeb 28, 2014
  6. He SunFeb 28, 2014

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.