From: Alex Riesen Date: Mon, 30 Apr 2007 22:26:36 +0000 (+0200) Subject: Fix read_mailmap to handle a caller uninterested in repo abbreviation X-Git-Tag: v1.5.2-rc1~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8503ee4394dd47af136019bd8da53e5adec17e5d;p=git.git 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 --- 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)) {