Code

Make us be better at guessing a good hostname for the email.
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 19 Apr 2005 22:46:06 +0000 (15:46 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 19 Apr 2005 22:46:06 +0000 (15:46 -0700)
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.

commit-tree.c

index 71fce3f357f2287acdeb0e6c62122f4b19e677af..043c7aa371101a1ea8cfc467279abf6c8acc7fd1 100644 (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);