Code

test-lib: allow exit trap to be used for cleanup by tests
[git.git] / builtin-blame.c
index 83141fc84e22ad4852f255fa1ad453cc125a3255..9dc333591045b4232e47eec32488e5a2104540c7 100644 (file)
@@ -873,7 +873,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
         * Prepare mmfile that contains only the lines in ent.
         */
        cp = nth_line(sb, ent->lno);
-       file_o.ptr = (char*) cp;
+       file_o.ptr = (char *) cp;
        cnt = ent->num_lines;
 
        while (cnt && cp < sb->final_buf + sb->final_buf_size) {
@@ -1704,7 +1704,7 @@ static int prepare_lines(struct scoreboard *sb)
        while (len--) {
                if (bol) {
                        sb->lineno = xrealloc(sb->lineno,
-                                             sizeof(int) * (num + 1));
+                                             sizeof(int *) * (num + 1));
                        sb->lineno[num] = buf - sb->final_buf;
                        bol = 0;
                }
@@ -1714,7 +1714,7 @@ static int prepare_lines(struct scoreboard *sb)
                }
        }
        sb->lineno = xrealloc(sb->lineno,
-                             sizeof(int) * (num + incomplete + 1));
+                             sizeof(int *) * (num + incomplete + 1));
        sb->lineno[num + incomplete] = buf - sb->final_buf;
        sb->num_lines = num + incomplete;
        return sb->num_lines;
@@ -1889,7 +1889,7 @@ static const char *parse_loc(const char *spec,
                return spec;
 
        /* it could be a regexp of form /.../ */
-       for (term = (char*) spec + 1; *term && *term != '/'; term++) {
+       for (term = (char *) spec + 1; *term && *term != '/'; term++) {
                if (*term == '\\')
                        term++;
        }
@@ -2229,7 +2229,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
        save_commit_buffer = 0;
        dashdash_pos = 0;
 
-       parse_options_start(&ctx, argc, argv, PARSE_OPT_KEEP_DASHDASH |
+       parse_options_start(&ctx, argc, argv, prefix, PARSE_OPT_KEEP_DASHDASH |
                            PARSE_OPT_KEEP_ARGV0);
        for (;;) {
                switch (parse_options_step(&ctx, options, blame_opt_usage)) {