]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-shortlog.c
return the prune-packed progress display to the inner loop
[git.git] / builtin-shortlog.c
index b57a88a6b0da36562bc2ce9d0d9e11b12ad990c3..3fe754677d3f7ab11419a04dd828c70b5958ed87 100644 (file)
@@ -39,10 +39,7 @@ static void insert_author_oneline(struct path_list *list,
        while (authorlen > 0 && isspace(author[authorlen - 1]))
                authorlen--;
 
-       buffer = xmalloc(authorlen + 1);
-       memcpy(buffer, author, authorlen);
-       buffer[authorlen] = '\0';
-
+       buffer = xmemdupz(author, authorlen);
        item = path_list_insert(buffer, list);
        if (item->util == NULL)
                item->util = xcalloc(1, sizeof(struct path_list));
@@ -66,13 +63,9 @@ static void insert_author_oneline(struct path_list *list,
                oneline++;
                onelinelen--;
        }
-
        while (onelinelen > 0 && isspace(oneline[onelinelen - 1]))
                onelinelen--;
-
-       buffer = xmalloc(onelinelen + 1);
-       memcpy(buffer, oneline, onelinelen);
-       buffer[onelinelen] = '\0';
+       buffer = xmemdupz(oneline, onelinelen);
 
        if (dot3) {
                int dot3len = strlen(dot3);
@@ -283,8 +276,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
        if (argc > 1)
                die ("unrecognized argument: %s", argv[1]);
 
-       if (!access(".mailmap", R_OK))
-               read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);
+       read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);
 
        if (rev.pending.nr == 0) {
                if (isatty(0))
@@ -332,4 +324,3 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 
        return 0;
 }
-