Re: [PATCH 03/19] diff.c: drop 'nofirst' from emit_line_0
- Date: Tue, 16 May 2017 09:05:27 -0700
- From: Jonathan Tan <jonathantanmy@xxxxxxxxxx>
- Subject: Re: [PATCH 03/19] diff.c: drop 'nofirst' from emit_line_0
On Mon, May 15, 2017 at 11:33 AM, Stefan Beller <sbeller@xxxxxxxxxx> wrote:
> On Mon, May 15, 2017 at 11:26 AM, Jonathan Tan <jonathantanmy@xxxxxxxxxx> wrote:
>> I also don't understand the meaning of this paragraph - if you mean that
>> this patch teaches other callers to hardcode the sign, I don't see any such
>> changes in the diff below.
> The last two hunks of the patch switch two callers that call with a sign
> that is hard to reason about.
The last two hunks don't hardcode any signs, as far as I can see. They
do pass in a "first" character that may or may not be a sign, if that
is what you mean.
In any case, can you reword that paragraph into an imperative
statement (e.g. "teach X to...", "make X...")?
>>> + char term;
>>> + term = options->line_termination;
>>> + term = '\0';
>>> + emit_line(options, NULL, NULL,
>>> + term, 1);
>> If options->line_termination is 0, this is actually a zero-length string
>> (not 1).
> So passing in !!options->line_termination should be fine?
Yes, that would work. I slightly prefer !!term.