git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] make filepairs detachable
@ 2006-06-30  0:27 Alex Riesen
  2006-06-30  1:16 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Riesen @ 2006-06-30  0:27 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Junio C Hamano

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-30  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-30  0:27 [PATCH 2/4] make filepairs detachable Alex Riesen
2006-06-30  1:16 ` Junio C Hamano
2006-06-30  7:42   ` Alex Riesen
2006-06-30  7:50     ` Junio C Hamano
2006-06-30  8:21       ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).