Skip to content

Commit 10a20b4

Browse files
committed
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
2 parents b4bd6bb + e5e9b56 commit 10a20b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

combine-diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ static int make_hunks(struct sline *sline, unsigned long cnt,
423423
hunk_begin, j);
424424
la = (la + context < cnt + 1) ?
425425
(la + context) : cnt + 1;
426-
while (j <= --la) {
426+
while (la && j <= --la) {
427427
if (sline[la].flag & mark) {
428428
contin = 1;
429429
break;

0 commit comments

Comments
 (0)