summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Alex Riesen <raa.lkml@gmail.com>2007-05-01 00:26:36 +0200
committerLibravatar Junio C Hamano <junkio@cox.net>2007-04-30 16:57:50 -0700
commit8503ee4394dd47af136019bd8da53e5adec17e5d (patch)
tree22d69355ef77a6ffcb6b7a1ffcba52778af039a0
parentUse strlcpy instead of strncpy in mailmap.c (diff)
downloadtgif-8503ee4394dd47af136019bd8da53e5adec17e5d.tar.xz
Fix read_mailmap to handle a caller uninterested in repo abbreviation
The only such a caller builtin-blame.c would pass NULL as the place where to store the abbreviation. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--mailmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mailmap.c b/mailmap.c
index c29e4e5349..38359a23b0 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -17,6 +17,9 @@ int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev
int abblen = sizeof(abbrev) - 1;
int len = strlen(buffer);
+ if (!repo_abbrev)
+ continue;
+
if (len && buffer[len - 1] == '\n')
buffer[--len] = 0;
if (!strncmp(buffer, abbrev, abblen)) {