Re: [PATCH] blame.c: fix garbled error message
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 13, 2015, 00:11 UTC
- Message-ID
- <xmqqzj9n4k11.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150112231231.GA4023@peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> As an aside, I have often been tempted to have xstrdup silently > propagate a NULL. It would have been the right thing to do here, but > maybe there are cases where the segfault is preferable for catching a > mistake early (otherwise you might store the NULL and then segfault much > later).
Great minds think alike. The sentence after "but maybe ..." was what I had in mind as a response in anticipation that somebody might suggest that; a separate xstrdup_or_null() might be fine, but I'd rather not to have xstrdup() that is _too_ magical.