Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'rs/combine-diff-zero-context-at-the-beginning'
author
Junio C Hamano
<gitster@pobox.com>
Mon, 16 Apr 2012 19:41:59 +0000
(12:41 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 16 Apr 2012 19:41:59 +0000
(12:41 -0700)
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
combine-diff.c
patch
|
blob
|
history
raw
(from parent 1:
c0599f6
)
diff --git
a/combine-diff.c
b/combine-diff.c
index a2e8dcf8553ff15d7cfed8f8ec4735185ec162bb..978668036835e16df4b6bfd37a7b1e9f8494cf07 100644
(file)
--- a/
combine-diff.c
+++ b/
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;