From 5f04fecd005f6566f9931ba7b692bd6ca109bc87 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sat, 12 Jan 2019 10:04:05 +0100 Subject: Don't allow empty username for git When no real name is set in /etc/passwd the username ends up being ",,,". Git does not like that. Actually, only the part before the first comma is the name, the rest is office and phone number. We don't want those. Before we only testing for the username being a NULL pointer. Reported-by: Keith Grimes Signed-off-by: Robert C. Helling --- core/save-git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/save-git.c') diff --git a/core/save-git.c b/core/save-git.c index 33c01ab83..67a9cb55b 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -1034,7 +1034,7 @@ static int get_authorship(git_repository *repo, git_signature **authorp) /* try to fetch the user info from the OS, otherwise use default values. */ struct user_info user = { .name = NULL, .email = NULL }; subsurface_user_info(&user); - if (!user.name) + if (!user.name || !*user.name) user.name = strdup("Subsurface"); if (!user.email) user.email = strdup("subsurface-app-account@subsurface-divelog.org"); -- cgit v1.2.3-70-g09d2