git-show-branch doc: show -g as synonym to --reflog in the list
[gitweb.git] / mailmap.c
index 38359a23b09e393fe620870dca5c3cf9e85fbb48..88fc6f394684436967002ca477eac1e084537348 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,7 +1,8 @@
 #include "cache.h"
-#include "path-list.h"
+#include "string-list.h"
+#include "mailmap.h"
 
-int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev)
+int read_mailmap(struct string_list *map, const char *filename, char **repo_abbrev)
 {
        char buffer[1024];
        FILE *f = fopen(filename, "r");
@@ -41,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);
@@ -52,16 +54,16 @@ int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev
                for (i = 0; i < right_bracket - left_bracket - 1; i++)
                        email[i] = tolower(left_bracket[i + 1]);
                email[right_bracket - left_bracket - 1] = '\0';
-               path_list_insert(email, map)->util = name;
+               string_list_insert(email, map)->util = name;
        }
        fclose(f);
        return 0;
 }
 
-int map_email(struct path_list *map, const char *email, char *name, int maxlen)
+int map_email(struct string_list *map, const char *email, char *name, int maxlen)
 {
        char *p;
-       struct path_list_item *item;
+       struct string_list_item *item;
        char buf[1024], *mailbuf;
        int i;
 
@@ -78,7 +80,7 @@ int map_email(struct path_list *map, const char *email, char *name, int maxlen)
        for (i = 0; i < p - email; i++)
                mailbuf[i] = tolower(email[i]);
        mailbuf[i] = 0;
-       item = path_list_lookup(mailbuf, map);
+       item = string_list_lookup(mailbuf, map);
        if (mailbuf != buf)
                free(mailbuf);
        if (item != NULL) {
@@ -88,4 +90,3 @@ int map_email(struct path_list *map, const char *email, char *name, int maxlen)
        }
        return 0;
 }
-