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.
This commit is contained in:
Linus Torvalds 2005-04-19 15:46:06 -07:00
parent 17cf781661
commit b96afa59eb

View File

@ -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);