From: Jonathan Nieder Date: Sat, 8 May 2010 21:07:39 +0000 (-0500) Subject: pretty: initialize new cmt_fmt_map to 0 X-Git-Tag: v1.7.2-rc0~85^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/95a2618f60a61fae8097695255419f257f74dff9?ds=inline;hp=-c pretty: initialize new cmt_fmt_map to 0 Without this change, is_alias is likely to happen to be nonzero, resulting in "fatal: invalid --pretty format" when the fake alias cannot be resolved. Use memset instead of initializing the members one by one to make it easier to expand the struct in the future if needed. t4205 (log --pretty) does not pass for me without this fix. Cc: Will Palmer Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- 95a2618f60a61fae8097695255419f257f74dff9 diff --git a/pretty.c b/pretty.c index aaf80207c9..4784f676fa 100644 --- a/pretty.c +++ b/pretty.c @@ -59,6 +59,7 @@ static int git_pretty_formats_config(const char *var, const char *value, void *c ALLOC_GROW(commit_formats, commit_formats_len+1, commit_formats_alloc); commit_format = &commit_formats[commit_formats_len]; + memset(commit_format, 0, sizeof(*commit_format)); commit_formats_len++; }