Code

Fix read_mailmap to handle a caller uninterested in repo abbreviation
authorAlex Riesen <raa.lkml@gmail.com>
Mon, 30 Apr 2007 22:26:36 +0000 (00:26 +0200)
committerJunio C Hamano <junkio@cox.net>
Mon, 30 Apr 2007 23:57:50 +0000 (16:57 -0700)
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>
mailmap.c

index c29e4e534925d250007507b3259855213b9500cc..38359a23b09e393fe620870dca5c3cf9e85fbb48 100644 (file)
--- 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)) {