Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-17 00:49:17 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-17 01:00:30 +0300
commit079fe1dae8504c988c50ce41eba78743d3f588e0 (patch)
tree540262f8d88313124fb3faef6c57ad652e791491 /xdiff-interface.c
parent127f72e6897d6671725dc13db42ab5ee1d086721 (diff)
Re-re-re-fix common tail optimization
We need to be extra careful recovering the removed common section, so that we do not break context nor the changed incomplete line (i.e. the last line that does not end with LF). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff-interface.c')
-rw-r--r--xdiff-interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xdiff-interface.c b/xdiff-interface.c
index 98b02eda35..9ee877c6f4 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -121,7 +121,7 @@ static void trim_common_tail(mmfile_t *a, mmfile_t *b, long ctx)
bp -= blk;
}
- while (recovered < trimmed && ctx)
+ while (recovered < trimmed && 0 <= ctx)
if (ap[recovered++] == '\n')
ctx--;
a->size -= (trimmed - recovered);