X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-log.c;h=9d1ceae44c6a449d2329e897b9705a5b457187f0;hb=e70866f53a8d31cde6cfff6396ba0d1f64029afb;hp=691cf3aef785950132c6be65f8aab39d4b12207e;hpb=182a8dabd5f5f646608f3857f10f3ac18c3d1445;p=git.git diff --git a/builtin-log.c b/builtin-log.c index 691cf3aef..9d1ceae44 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -101,7 +101,7 @@ static int git_format_config(const char *var, const char *value) if (!strcmp(var, "format.headers")) { int len = strlen(value); extra_headers_size += len + 1; - extra_headers = realloc(extra_headers, extra_headers_size); + extra_headers = xrealloc(extra_headers, extra_headers_size); extra_headers[extra_headers_size - len - 1] = 0; strcat(extra_headers, value); return 0; @@ -348,6 +348,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (!rev.diffopt.output_format) rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH; + if (!output_directory) + output_directory = prefix; + if (output_directory) { if (use_stdout) die("standard output, or directory, which one?"); @@ -381,7 +384,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) continue; nr++; - list = realloc(list, nr * sizeof(list[0])); + list = xrealloc(list, nr * sizeof(list[0])); list[nr - 1] = commit; } total = nr;