summaryrefslogtreecommitdiff
path: root/tar-tree.c
diff options
context:
space:
mode:
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>2005-06-02 18:50:48 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-03 01:30:08 (GMT)
commit9b5b9f398c56f83839bdc4fc630f38afadc94c21 (patch)
treea504b4a4da2a2241a97865c11dea4d17f5381ff2 /tar-tree.c
parenta7b209091ad2a8277727d62ef1193e109b7fe9ff (diff)
downloadgit-9b5b9f398c56f83839bdc4fc630f38afadc94c21.zip
git-9b5b9f398c56f83839bdc4fc630f38afadc94c21.tar.gz
git-9b5b9f398c56f83839bdc4fc630f38afadc94c21.tar.bz2
[PATCH] git-tar-tree: cleanup write_trailer()
replace open-coded variants of get_record(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'tar-tree.c')
-rw-r--r--tar-tree.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/tar-tree.c b/tar-tree.c
index 233a256..c2eb21c 100644
--- 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();
}
}