summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--count-delta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/count-delta.c b/count-delta.c
index 4e4d2f4fcc..3ee3a0ccf1 100644
--- a/count-delta.c
+++ b/count-delta.c
@@ -26,7 +26,7 @@ static void touch_range(struct span **span,
again:
if (ofs < e->end) {
while (e->end < end) {
- if (e->next) {
+ if (e->next && e->next->ofs <= end) {
e->end = e->next->ofs;
e = e->next;
}