X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=apply.c;h=244718ca13aa58567974ea3b72d58c0365cc3c21;hb=8c0db2f5193153ea8a51bb45b0512c5a3889023b;hp=35ae48eeb580a95399fd213c5813fc0fa4ec40c2;hpb=becb6a658c43633850a2417935c108266056b765;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;