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

Re: [PATCH] parse-options: fix parsing of "--foobar=" with no value

From
OMOlivier Marin <dkr+ml.git@free.fr>
Date
Jul 22, 2008, 19:25 UTC
Message-ID
<48863436.50309@free.fr>
In-Reply-To
<20080722185427.GA10453@artemis.madism.org>
Pierre Habouzit a écrit :
Show 5 quoted lines
> On Tue, Jul 22, 2008 at 06:44:27PM +0000, Olivier Marin wrote:
> 
>   Wrong, --foobar= is the option "foobar" with the argument "" (empty
> string). as soon as you use the --foobar=... form, that is the "stuck
> form" for long option, there *is* a value.
Ah, OK.

I would have find it convenient for things like --foobar=$var where foobar fallback to default when $var is empty. But I don't care that much.

Show 5 quoted lines
>   IOW --foobar= is not the same as --foobar at all. If like you claim,
> --foobar= pass a "random" value to the option then *this* is a bug, it
> should pass a pointer to an empty string (IOW a pointer that points to a
> NUL byte), but I see nothing in the code that would explain what you
> claim.

I found the "random bug" while migrating "git init" to parse-options. I think you can reproduce it with:

$ git clone --template= <repo> error: ignoring template /var/run/synaptic.socket fatal: cannot opendir /var/run/sudo

But now, it appears the problem is not in parse-options, sorry.
-- 
Olivier.
Previous: Pierre HabouzitNext: Johannes Schindelin
Message 4 of 6 in “parse-options: fix parsing of "--foobar=" with no value”
  1. parse-options: fix parsing of "--foobar=" with no valueOlivier Marin, Jul 22, 2008
  2. Sverre RabbelierJul 22, 2008
  3. Pierre HabouzitJul 22, 2008
  4. Olivier MarinJul 22, 2008
  5. Johannes SchindelinJul 22, 2008
  6. Jeff KingJul 22, 2008

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.