Re: [PATCH 05/83] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Apr 26, 2016, 16:15 UTC
- Message-ID
- <CAP8UFD228joDLyomvae7rVs02TuTbmEHerwWvH=VR+FE-YFLRA@mail.gmail.com>
- In-Reply-To
- <CAGZ79kYi0seMF12+Y4VxHBJxTh9wo4LUw0A50PYRvZEBvj6SBA@mail.gmail.com>
On Mon, Apr 25, 2016 at 8:50 PM, Stefan Beller <sbeller@google.com> wrote:
Show 23 quoted lines
>> @@ -2251,7 +2319,7 @@ static int match_fragment(struct image *img,
>> int match_beginning, int match_end)
>> {
>> int i;
>> - char *fixed_buf, *buf, *orig, *target;
>> + char *fixed_buf, *orig, *target;
>> struct strbuf fixed;
>> size_t fixed_len, postlen;
>> int preimage_limit;
>> @@ -2312,6 +2380,7 @@ static int match_fragment(struct image *img,
>> * There must be one non-blank context line that match
>> * a line before the end of img.
>> */
>> + char *buf;
>
> patches 1-4 looking good, with no comment from me. Here is the first spot to
> comment on.
>
> It's not clear why we need to declare buf here? Oh wait it is. It's just
> moved from the start of the function. But why do it in this patch?
> It seems unrelated to the general intent of the patch. No need to reroll
> for this nit alone, it just took me a while to figure out it was an unrelated
> thing.Yeah, I agree it's a bit unrelated. But rather than add another patch to an already long series just for this, I added the following to the commit message:
While at it, let's reduce the scope of "char *buf" in match_fragment().