summaryrefslogtreecommitdiff
path: root/builtin-shortlog.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-11-19 16:29:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-20 06:59:05 (GMT)
commit549652361b7fea5a5e9046571c9f0bc4a7d5d6ef (patch)
treec7df20214d49b13018a71731489c1a6794da171d /builtin-shortlog.c
parentd8e812502f1c72f5ef542de7eb05874e27f2b086 (diff)
downloadgit-549652361b7fea5a5e9046571c9f0bc4a7d5d6ef.zip
git-549652361b7fea5a5e9046571c9f0bc4a7d5d6ef.tar.gz
git-549652361b7fea5a5e9046571c9f0bc4a7d5d6ef.tar.bz2
shortlog: handle email addresses case-insensitively
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-shortlog.c')
-rw-r--r--builtin-shortlog.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index afc9456..4775c11 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -34,6 +34,7 @@ static int read_mailmap(const char *filename)
while (fgets(buffer, sizeof(buffer), f) != NULL) {
char *end_of_name, *left_bracket, *right_bracket;
char *name, *email;
+ int i;
if (buffer[0] == '#')
continue;
if ((left_bracket = strchr(buffer, '<')) == NULL)
@@ -50,7 +51,9 @@ static int read_mailmap(const char *filename)
name = xmalloc(end_of_name - buffer + 1);
strlcpy(name, buffer, end_of_name - buffer + 1);
email = xmalloc(right_bracket - left_bracket);
- strlcpy(email, left_bracket + 1, right_bracket - left_bracket);
+ for (i = 0; i < right_bracket - left_bracket - 1; i++)
+ email[i] = tolower(left_bracket[i + 1]);
+ email[right_bracket - left_bracket - 1] = '\0';
path_list_insert(email, &mailmap)->util = name;
}
fclose(f);
@@ -68,6 +71,9 @@ static int map_email(char *email, char *name, int maxlen)
return 0;
*p = '\0';
+ /* downcase the email address */
+ for (p = email; *p; p++)
+ *p = tolower(*p);
item = path_list_lookup(email, &mailmap);
if (item != NULL) {
const char *realname = (const char *)item->util;