Remove SIMPLE_PROGRAMS and make git-daemon a normal program.
[gitweb.git] / blame.c
diff --git a/blame.c b/blame.c
index c253b9ca45cf7d860052ddae95bc1ed34974ffb8..3e227d27124ff3eb09409a781c532de5bfc52369 100644 (file)
--- a/blame.c
+++ b/blame.c
@@ -18,7 +18,9 @@
 #include "revision.h"
 #include "xdiff-interface.h"
 
+#ifndef DEBUG
 #define DEBUG 0
+#endif
 
 static const char blame_usage[] = "git-blame [-c] [-l] [-t] [-S <revs-file>] [--] file [commit]\n"
        "  -c, --compatibility Use the same output mode as git-annotate (Default: off)\n"
@@ -165,7 +167,7 @@ static int get_blob_sha1(struct tree *t, const char *pathname,
        blame_file = pathname;
        pathspec[0] = pathname;
        pathspec[1] = NULL;
-       memset(blob_sha1, 0, sizeof(blob_sha1));
+       hashclr(blob_sha1);
        read_tree_recursive(t, "", 0, 0, pathspec, get_blob_sha1_internal);
 
        for (i = 0; i < 20; i++) {
@@ -176,7 +178,7 @@ static int get_blob_sha1(struct tree *t, const char *pathname,
        if (i == 20)
                return -1;
 
-       memcpy(sha1, blob_sha1, 20);
+       hashcpy(sha1, blob_sha1);
        return 0;
 }
 
@@ -191,7 +193,7 @@ static int get_blob_sha1_internal(const unsigned char *sha1, const char *base,
            strcmp(blame_file + baselen, pathname))
                return -1;
 
-       memcpy(blob_sha1, sha1, 20);
+       hashcpy(blob_sha1, sha1);
        return -1;
 }
 
@@ -232,6 +234,9 @@ static void print_map(struct commit *cmit, struct commit *other)
            util2->num_lines ? util->num_lines : util2->num_lines;
        int num;
 
+       if (print_map == NULL)
+               ; /* to avoid "unused function" warning */
+
        for (i = 0; i < max; i++) {
                printf("i: %d ", i);
                num = -1;
@@ -617,7 +622,7 @@ static void simplify_commit(struct rev_info *revs, struct commit *commit)
                                if (new_name) {
                                        struct util_info* putil = get_util(p);
                                        if (!putil->pathname)
-                                               putil->pathname = strdup(new_name);
+                                               putil->pathname = xstrdup(new_name);
                                } else {
                                        *pp = parent->next;
                                        continue;