Skip to content

Commit dda2665

Browse files
committed
Merge branch 'sb/diff-color-move-more'
Bugfix. * sb/diff-color-move-more: diff: fix --color-moved-ws=allow-indentation-change
2 parents bd3941a + fab01ec commit dda2665

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

diff.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,13 @@ static void pmb_advance_or_null_multi_match(struct diff_options *o,
980980
/* Carry the white space delta forward */
981981
pmb[i]->next_line->wsd = pmb[i]->wsd;
982982
pmb[i] = pmb[i]->next_line;
983-
} else
983+
} else {
984+
if (pmb[i]->wsd) {
985+
free(pmb[i]->wsd->string);
986+
FREE_AND_NULL(pmb[i]->wsd);
987+
}
984988
pmb[i] = NULL;
989+
}
985990
}
986991
}
987992

@@ -1002,10 +1007,6 @@ static int shrink_potential_moved_blocks(struct moved_entry **pmb,
10021007

10031008
if (lp < pmb_nr && rp > -1 && lp < rp) {
10041009
pmb[lp] = pmb[rp];
1005-
if (pmb[rp]->wsd) {
1006-
free(pmb[rp]->wsd->string);
1007-
FREE_AND_NULL(pmb[rp]->wsd);
1008-
}
10091010
pmb[rp] = NULL;
10101011
rp--;
10111012
lp++;

0 commit comments

Comments
 (0)