git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Next: Junio C Hamano
Message 1 of 5 in “make filepairs detachable”
  1. 2/4 make filepairs detachableAlex Riesen, Jun 30, 2006
  2. Junio C HamanoJun 30, 2006
  3. Alex RiesenJun 30, 2006
  4. Junio C HamanoJun 30, 2006
  5. Alex RiesenJun 30, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.