git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-tar-tree: cleanup write_trailer() (resent)
@ 2005-06-02 18:50 Rene Scharfe
  0 siblings, 0 replies; only message in thread
From: Rene Scharfe @ 2005-06-02 18:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

git-tar-tree: replace open-coded variants of get_record().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>

diff --git a/tar-tree.c b/tar-tree.c
--- a/tar-tree.c
+++ b/tar-tree.c
@@ -73,16 +73,13 @@ static char *get_record(void)
  */
 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;
+		get_record();
+		write_if_needed();
 	}
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-02 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-02 18:50 [PATCH] git-tar-tree: cleanup write_trailer() (resent) Rene Scharfe

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).