summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>2005-06-03 11:25:18 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-03 14:36:42 (GMT)
commita325a11b88bc13d569be1571ce559858dc224af4 (patch)
treec1b6338cf2cae327cb5830e406dd643c09093ec9
parentd3d49c3d3559d4b5e79ae99fe485af48606d5cab (diff)
downloadgit-a325a11b88bc13d569be1571ce559858dc224af4.zip
git-a325a11b88bc13d569be1571ce559858dc224af4.tar.gz
git-a325a11b88bc13d569be1571ce559858dc224af4.tar.bz2
[PATCH] git-tar-tree: fix write_trailer
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>
-rw-r--r--tar-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tar-tree.c b/tar-tree.c
index c2eb21c..4c47fc2 100644
--- a/tar-tree.c
+++ b/tar-tree.c
@@ -77,7 +77,7 @@ static void write_trailer(void)
write_if_needed();
get_record();
write_if_needed();
- if (offset) {
+ while (offset) {
get_record();
write_if_needed();
}