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
This commit is contained in:
@ -423,7 +423,7 @@ static int make_hunks(struct sline *sline, unsigned long cnt,
|
|||||||
hunk_begin, j);
|
hunk_begin, j);
|
||||||
la = (la + context < cnt + 1) ?
|
la = (la + context < cnt + 1) ?
|
||||||
(la + context) : cnt + 1;
|
(la + context) : cnt + 1;
|
||||||
while (j <= --la) {
|
while (la && j <= --la) {
|
||||||
if (sline[la].flag & mark) {
|
if (sline[la].flag & mark) {
|
||||||
contin = 1;
|
contin = 1;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user