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

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

From
GSGovind Salinas <govind@sophiasuchtig.com>
Date
Feb 9, 2008, 20:16 UTC
Message-ID
<5d46db230802091216h40f88f06r20ebb84de6717af6@mail.gmail.com>
Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
---
 config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config.c b/config.c
index 498259e..8247e88 100644
--- a/config.c
+++ b/config.c
@@ -407,12 +407,12 @@ 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;
 	}

-	if (!strcmp(var, "user.email")) {
+	if (value && !strcmp(var, "user.email")) {
 		strlcpy(git_default_email, value, sizeof(git_default_email));
 		return 0;
 	}
-- 
1.5.4.36.g9af61
Next: Junio C Hamano
Message 1 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.