# [PATCH] Fix read_mailmap to handle a caller uninterested in repo abbreviation

1 messages from 2007-04-30 to 2007-04-30. Participants: Alex Riesen.
Thread: https://gitlist.dev/t/7909

## Alex Riesen, 2007-04-30 22:26

Subject: [PATCH] Fix read_mailmap to handle a caller uninterested in repo abbreviation
Message-ID: <20070430222636.GB5000@steel.home>
URL: https://gitlist.dev/e/20070430222636.GB5000%40steel.home

```
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>
---

No one seem to be using the feature. No wonder: it has exotic use
case, strange configuration, not documented, there is only one call
site (shortlog), and there, why does it not happen automatically anyway?

 mailmap.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/mailmap.c b/mailmap.c
index c29e4e5..38359a2 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)) {
-- 
1.5.2.rc0.792.g7f4bd0

```
