Группа :: Архивирование/Резервное копирование
Пакет: tar
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: tar-1.15.1-cvs-20050512-pad.patch
2005-05-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/create.c (dump_regular_file): Correctly pad archive members
that shrunk during archiving. Repored by Frank Heckenbach.
--- src/create.c 2 May 2005 08:02:09 -0000 1.96
+++ src/create.c 12 May 2005 15:39:21 -0000 1.97
@@ -886,9 +886,9 @@ dump_regular_file (int fd, struct tar_st
return dump_status_short;
}
size_left -= count;
-
- set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
-
+ if (count)
+ set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
+
if (count != bufsize)
{
char buf[UINTMAX_STRSIZE_BOUND];
@@ -901,7 +901,7 @@ dump_regular_file (int fd, struct tar_st
STRINGIFY_BIGINT (size_left, buf)));
if (! ignore_failed_read_option)
exit_status = TAREXIT_FAILURE;
- pad_archive (size_left);
+ pad_archive (size_left - (bufsize-count));
return dump_status_short;
}
}