summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d3d49c3)
raw | patch | inline | side by side (parent: d3d49c3)
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Fri, 3 Jun 2005 11:25:18 +0000 (13:25 +0200) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Fri, 3 Jun 2005 14:36:42 +0000 (07:36 -0700) |
write_trailer() writes the last 10k (a full block) of the tar archive.
write_if_needed() writes out a block *if* it is full and then sets
the offset to 0. In nine out of ten cases the messed up write_trailer()
function didn't manage to fill the block thus not writing anything at
all, truncating the archive. I was "lucky" to hit the other case and so
my testing ran OK.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
write_if_needed() writes out a block *if* it is full and then sets
the offset to 0. In nine out of ten cases the messed up write_trailer()
function didn't manage to fill the block thus not writing anything at
all, truncating the archive. I was "lucky" to hit the other case and so
my testing ran OK.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
tar-tree.c | patch | blob | history |
diff --git a/tar-tree.c b/tar-tree.c
index c2eb21c97bd75567ded74e89b2b118730710ba01..4c47fc2bec1e6305d122865e2da318bc795ab8ef 100644 (file)
--- a/tar-tree.c
+++ b/tar-tree.c
write_if_needed();
get_record();
write_if_needed();
- if (offset) {
+ while (offset) {
get_record();
write_if_needed();
}