summaryrefslogtreecommitdiffstats
path: root/core/save-git.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-01-12 10:04:05 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-22 13:06:17 +1300
commitfc66c767fbf552743c13ecec4141a4c153490cd5 (patch)
treef60f65003442e154d1f39e5ec313e280e70757f0 /core/save-git.c
parent7598e2fce724ba42d1b9be4dbd7adfa169473e28 (diff)
downloadsubsurface-fc66c767fbf552743c13ecec4141a4c153490cd5.tar.gz
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 <helling@atdotde.de>
Diffstat (limited to 'core/save-git.c')
-rw-r--r--core/save-git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/save-git.c b/core/save-git.c
index 422201324..ac6c4d922 100644
--- a/core/save-git.c
+++ b/core/save-git.c
@@ -1040,7 +1040,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");