Browse files

Merge branch 'rs/combine-diff-zero-context-at-the-beginning' into maint

An age-old corner case bug in combine diff (only triggered with -U0
and the hunk at the beginning of the file needs to be shown) has been
fixed.

By René Scharfe
* rs/combine-diff-zero-context-at-the-beginning:
  combine-diff: fix loop index underflow
  • Loading branch information...
2 parents b4bd6bb + e5e9b56 commit 10a20b43c3d03ea1fab9095f96eda66086d3dcd2 @gitster gitster committed Apr 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 combine-diff.c
View
2 combine-diff.c
@@ -423,7 +423,7 @@ static int make_hunks(struct sline *sline, unsigned long cnt,
hunk_begin, j);
la = (la + context < cnt + 1) ?
(la + context) : cnt + 1;
- while (j <= --la) {
+ while (la && j <= --la) {
if (sline[la].flag & mark) {
contin = 1;
break;

0 comments on commit 10a20b4

Please sign in to comment.