From: Junio C Hamano Date: Sat, 04 Jun 2016 02:03:59 GMT Subject: Re: [PATCH 1/3] pretty: support "mboxrd" output format Message-ID: In-Reply-To: On Fri, Jun 3, 2016 at 5:19 PM, Eric Sunshine wrote: > > 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?