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

Re: [PATCH] commit.c: guard config parser from value=NULL

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2008, 02:57 UTC
Message-ID
<7vir0x5xi0.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<5d46db230802091216h40f88f06r20ebb84de6717af6@mail.gmail.com>
"Govind Salinas" <govind@sophiasuchtig.com> writes:
Show 5 quoted lines
> -	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]
        	name

we 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.
Previous: Govind Salinas
Message 2 of 2 in “commit.c: guard config parser from value=NULL”
  1. commit.c: guard config parser from value=NULLGovind Salinas, Feb 9, 2008
  2. Junio C HamanoFeb 10, 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.