diff options
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -40,10 +40,9 @@ static int git_pretty_formats_config(const char *var, const char *value, void *c const char *fmt; int i; - if (!starts_with(var, "pretty.")) + if (!skip_prefix(var, "pretty.", &name)) return 0; - name = var + strlen("pretty."); for (i = 0; i < builtin_formats_len; i++) { if (!strcmp(commit_formats[i].name, name)) return 0; @@ -1249,6 +1248,8 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ if (c->signature_check.key) strbuf_addstr(sb, c->signature_check.key); break; + default: + return 0; } return 2; } @@ -1375,7 +1376,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */ case trunc_none: break; } - strbuf_addstr(sb, local_sb.buf); + strbuf_addbuf(sb, &local_sb); } else { int sb_len = sb->len, offset = 0; if (c->flush_type == flush_left) @@ -1519,8 +1520,6 @@ void format_commit_message(const struct commit *commit, free(context.commit_encoding); unuse_commit_buffer(commit, context.message); - free(context.signature_check.gpg_output); - free(context.signature_check.signer); } static void pp_header(struct pretty_print_context *pp, |