[PATCH 2/4] make filepairs detachable
- From
Alex Riesen <fork0@t-online.de>
- Date
- Jun 30, 2006, 00:27 UTC
- Message-ID
- <20060630002736.GB22618@steel.home>
Actually, just make sure diff_flush does not crash for diff queue entries which were cleared.
--- diff.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c index 5a71489..b3480f6 100644 --- a/diff.c +++ b/diff.c @@ -2281,6 +2281,8 @@ void diff_flush(struct diff_options *opt } for (i = 0; i < q->nr; i++) { struct diff_filepair *p = q->queue[i]; + if (!p) + continue; flush_one_pair(p, diff_output_format, options, diffstat); } @@ -2290,6 +2292,8 @@ void diff_flush(struct diff_options *opt } for (i = 0; i < q->nr; i++) { + if (!q->queue[i]) + continue; if (diffstat && options->summary) diff_summary(q->queue[i]); diff_free_filepair(q->queue[i]);
-- 1.4.1.rc1.g17dc