Re: [PATCH 1/3] pretty: support "mboxrd" output format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 4, 2016, 02:03 UTC
- Message-ID
- <CAPc5daWJ1v8EU89UN2HPK8=U17vz4LiANA9FyCvH5as7Hb1bTQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cQ7y7J02+PVtdJywGEudOGXsy1jgadvVwBg5creiUv6zA@mail.gmail.com>
On Fri, Jun 3, 2016 at 5:19 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 9 quoted lines
> > My only minor reservation is that it your concise version is still > subtle with regard to not taking 'linelen' into account. At first > glance, it looks like a bug that it doesn't consider the logical > end-of-line, and someone reading the code has to put in extra effort > to convince himself that the code works as intended. > > For that reason, I have a bit of a preference for a version of > is_mboxrd_from() which does take 'linelen' into account explicitly.
That certainly is true. You could check that the end result did not consume more than linelen after the single-liner computes its result, but I am not sure under what condition that check would trigger. Even though we may hold the entire e-mail file without NUL-terminating each line, we have a NUL-termination at the end of the file, no?