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

[PATCH] git-tar-tree: cleanup trailer writing

From
Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
May 27, 2005, 21:16 UTC
Message-ID
<20050527211624.GA17478@lsrfire.ath.cx>
Replace open-coded variants of get_record().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Index: tar-tree.c
===================================================================
--- ba1de5878d8e0cd1c7c728379e033ea6bf8567e5/tar-tree.c  (mode:100644)
+++ fa5c736eeabbead4a4c024051d104930d836092a/tar-tree.c  (mode:100644)
@@ -73,16 +73,13 @@
  */
 static void write_trailer(void)
 {
-	memset(block + offset, 0, RECORDSIZE);
-	offset += RECORDSIZE;
+	get_record();
 	write_if_needed();
-	memset(block + offset, 0, RECORDSIZE);
-	offset += RECORDSIZE;
+	get_record();
 	write_if_needed();
-	if (offset) {
-		memset(block + offset, 0, BLOCKSIZE - offset);
-		reliable_write(block, BLOCKSIZE);
-		offset = 0;
+	while (offset) {
+		get_record();
+		write_if_needed();
 	}
 }
 
Message 1 of 1 in “git-tar-tree: cleanup trailer writing”
  1. git-tar-tree: cleanup trailer writingRene Scharfe, May 27, 2005

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.