提交 a325a11b 编写于 作者: R Rene Scharfe 提交者: Linus Torvalds

[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: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 d3d49c3d
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册