mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
[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>
This commit is contained in:
parent
a7b209091a
commit
9b5b9f398c
11
tar-tree.c
11
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user