X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=apply.c;h=244718ca13aa58567974ea3b72d58c0365cc3c21;hb=9121a1a1a0981a54fa53a66a3f77e09e88355b67;hp=35ae48eeb580a95399fd213c5813fc0fa4ec40c2;hpb=9101625d9f3482c5d5d02442c63fa9816729fa4f;p=git.git diff --git a/apply.c b/apply.c index 35ae48ee..244718ca 100644 --- a/apply.c +++ b/apply.c @@ -1142,6 +1142,14 @@ static int apply_one_fragment(struct buffer_desc *desc, struct fragment *frag) size -= len; } +#ifdef NO_ACCURATE_DIFF + if (oldsize > 0 && old[oldsize - 1] == '\n' && + newsize > 0 && new[newsize - 1] == '\n') { + oldsize--; + newsize--; + } +#endif + offset = find_offset(buf, desc->size, old, oldsize, frag->newpos); if (offset >= 0) { int diff = newsize - oldsize;