diff options
Diffstat (limited to 'line-log.c')
-rw-r--r-- | line-log.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/line-log.c b/line-log.c index 1008e72258..a9ce0147b7 100644 --- a/line-log.c +++ b/line-log.c @@ -237,7 +237,7 @@ static void diff_ranges_release(struct diff_ranges *diff) range_set_release(&diff->target); } -void line_log_data_init(struct line_log_data *r) +static void line_log_data_init(struct line_log_data *r) { memset(r, 0, sizeof(struct line_log_data)); range_set_init(&r->ranges, 0); @@ -533,7 +533,7 @@ static void fill_line_ends(struct diff_filespec *spec, long *lines, } /* shrink the array to fit the elements */ - ends = xrealloc(ends, cur * sizeof(*ends)); + REALLOC_ARRAY(ends, cur); *lines = cur-1; *line_ends = ends; } @@ -575,7 +575,7 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args) name_part = skip_range_arg(item->string); if (!name_part || *name_part != ':' || !name_part[1]) - die("-L argument '%s' not of the form start,end:file", + die("-L argument not 'start,end:file' or ':funcname:file': %s", item->string); range_part = xstrndup(item->string, name_part - item->string); name_part++; @@ -1141,6 +1141,9 @@ static int process_ranges_merge_commit(struct rev_info *rev, struct commit *comm int i; int nparents = commit_list_count(commit->parents); + if (nparents > 1 && rev->first_parent_only) + nparents = 1; + diffqueues = xmalloc(nparents * sizeof(*diffqueues)); cand = xmalloc(nparents * sizeof(*cand)); parents = xmalloc(nparents * sizeof(*parents)); |