aboutsummaryrefslogtreecommitdiff
path: root/commit-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'commit-tree.c')
-rw-r--r--commit-tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/commit-tree.c b/commit-tree.c
index 71fce3f35..043c7aa37 100644
--- a/commit-tree.c
+++ b/commit-tree.c
@@ -317,8 +317,10 @@ int main(int argc, char **argv)
memcpy(realemail, pw->pw_name, len);
realemail[len] = '@';
gethostname(realemail+len+1, sizeof(realemail)-len-1);
- strcat(realemail, ".");
- getdomainname(realemail+strlen(realemail), sizeof(realemail)-strlen(realemail)-1);
+ if (!strchr(realemail+len+1, '.')) {
+ strcat(realemail, ".");
+ getdomainname(realemail+strlen(realemail), sizeof(realemail)-strlen(realemail)-1);
+ }
time(&now);
tm = localtime(&now);