Re: [PATCH] guard config parser from value=NULL
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 9, 2008, 21:07 UTC
- Message-ID
- <7vhcghet3q.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <12025767241532-git-send-email-mkoegler@auto.tuwien.ac.at>
Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:
Show 9 quoted lines
> @@ -416,7 +416,7 @@ int git_default_config(const char *var, const char *value)
> return 0;
> }
>
> - if (!strcmp(var, "user.name")) {
> + if (value && !strcmp(var, "user.name")) {
> strlcpy(git_default_name, value, sizeof(git_default_name));
> return 0;
> }This is wrong, isn't it? When somebody says
[user]
namewe should not silently ignore it, but instead say "user.name is not a bool!" and error out.
The same comment applies to all other
if (value && !strcmp(var, "<varname>"))
conversions.