Skip to content

Commit f84e8b6

Browse files
committed
Merge branch 'rs/combine-diff-zero-context-at-the-beginning'
Fixes 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). By René Scharfe * rs/combine-diff-zero-context-at-the-beginning: combine-diff: fix loop index underflow
2 parents c0599f6 + e5e9b56 commit f84e8b6

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)