From: Linus Torvalds Date: Tue, 19 Apr 2005 22:46:06 +0000 (-0700) Subject: Make us be better at guessing a good hostname for the email. X-Git-Tag: v0.99~806 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b96afa59ebfd2c0902e2fd2653e29f291bf0cac7;p=git.git Make us be better at guessing a good hostname for the email. It's still just a guess, and the result is not a real email address anyway. If you want to, you can use COMMIT_AUTHOR_EMAIL to correct for any git guesses. --- diff --git a/commit-tree.c b/commit-tree.c index 71fce3f3..043c7aa3 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);