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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pierre Habouzit a écrit :
> 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.

>   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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux