diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-19 15:46:06 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-19 15:46:06 -0700 |
commit | b96afa59ebfd2c0902e2fd2653e29f291bf0cac7 (patch) | |
tree | 3d6e94ab9fe04737d6ad70e788c031ba551595c9 /commit-tree.c | |
parent | 17cf781661e6d38f737f15f53ab552f1e95960d7 (diff) | |
download | git-b96afa59ebfd2c0902e2fd2653e29f291bf0cac7.tar.gz git-b96afa59ebfd2c0902e2fd2653e29f291bf0cac7.tar.xz |
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.
Diffstat (limited to 'commit-tree.c')
-rw-r--r-- | commit-tree.c | 6 |
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); |