Re: [PATCH] diff: remove another ternary expression always evaluating to true

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

> 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).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]