Re: [PATCH 3/3] parse_commit(): handle broken whitespace-only timestamp

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

 



On Sat, Apr 22, 2023 at 08:37:15PM -0400, Jeff King wrote:

> > You could use (our own) isdigit() here instead.  It's more concise and
> > efficient.
> 
> Heh, yes, that is much better. I had strspn() on the mind since that is
> what split_ident_line() uses.
> 
> I think it could even just be:
> 
>   if (dateptr != eol)
> 
> which implies that we found some non-whitespace character, and then we
> rely on parse_timestamp() to return 0 (which is what the current code is
> effectively doing).

This should be "dateptr == eol" of course, because the body of the
conditional is "return 0" to signal an error. It's correct in the v2 of
the series I just sent out.

-Peff



[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]

  Powered by Linux