log: teach "terminator" vs "separator" mode to "--pretty=format"
[gitweb.git] / mailmap.c
index c29e4e534925d250007507b3259855213b9500cc..f0172552e4c42c1526e2395802a41070d43cadae 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "path-list.h"
+#include "mailmap.h"
 
 int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev)
 {
@@ -17,6 +18,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)) {
@@ -38,9 +42,10 @@ int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev
                        continue;
                if (right_bracket == left_bracket + 1)
                        continue;
-               for (end_of_name = left_bracket; end_of_name != buffer
-                               && isspace(end_of_name[-1]); end_of_name--)
-                       /* keep on looking */
+               for (end_of_name = left_bracket;
+                    end_of_name != buffer && isspace(end_of_name[-1]);
+                    end_of_name--)
+                       ; /* keep on looking */
                if (end_of_name == buffer)
                        continue;
                name = xmalloc(end_of_name - buffer + 1);
@@ -85,4 +90,3 @@ int map_email(struct path_list *map, const char *email, char *name, int maxlen)
        }
        return 0;
 }
-