From 8503ee4394dd47af136019bd8da53e5adec17e5d Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Tue, 1 May 2007 00:26:36 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- mailmap.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mailmap.c') diff --git a/mailmap.c b/mailmap.c index c29e4e534..38359a23b 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)) { -- cgit v1.2.1