Re: [PATCH] diff: remove another ternary expression always evaluating to true
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2013, 22:03 UTC
- Message-ID
- <7v8v0b96xe.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.1308082335050.24252@s15462909.onlinehome-server.info>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 11 quoted lines
> Hi Stefan, > > On Thu, 8 Aug 2013, Stefan Beller wrote: > >> So you rather propose to have >> - show_submodule_summary(o->file, one ? one->path : two->path, >> + show_submodule_summary(o->file, one->path ? one->path : two->path, > > I do. The reason is that one->path could be NULL (but not both one->path > and two->path) and the summary would not be as helpful as possible if it > wrote "(null)" instead of the path of the submodule.
Good.
Also some C libraries would choke when asked to %s format a NULL, instead of giving "(null)" to avoid segfaulting (which I think is a quirk in glibc).