From: Jonathan Nieder <jrnieder@gmail.com>
To: Will Palmer <wmpalmer@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net
Subject: [PATCH] pretty: initialize new cmt_fmt_map to 0
Date: Sat, 8 May 2010 16:07:39 -0500 [thread overview]
Message-ID: <20100508210739.GA6486@progeny.tock> (raw)
In-Reply-To: <1272798044-10487-4-git-send-email-wmpalmer@gmail.com>
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 <wmpalmer@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Sorry I missed this before. Sane?
Jonathan
pretty.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pretty.c b/pretty.c
index aaf8020..4784f67 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++;
}
--
1.7.1
next prev parent reply other threads:[~2010-05-08 21:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-02 11:00 [PATCH v4 0/3] pretty: format aliases Will Palmer
2010-05-02 11:00 ` [PATCH v4 1/3] pretty: make it easier to add new formats Will Palmer
2010-05-02 11:22 ` Jonathan Nieder
2010-05-02 11:00 ` [PATCH v4 2/3] pretty: add infrastructure to allow format aliases Will Palmer
2010-05-02 11:55 ` Jonathan Nieder
2010-05-02 11:00 ` [PATCH v4 3/3] pretty: add aliases for pretty formats Will Palmer
2010-05-02 12:30 ` Jonathan Nieder
2010-05-02 13:38 ` Will Palmer
2010-05-08 21:07 ` Jonathan Nieder [this message]
2010-05-08 22:04 ` [PATCH] pretty: initialize new cmt_fmt_map to 0 Will Palmer
2010-05-02 15:53 ` [PATCH v4 0/3] pretty: format aliases Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100508210739.GA6486@progeny.tock \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=wmpalmer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).