]> Dogcows Code - chaz/tar/commitdiff
(dump_regular_file): Correctly pad archive members that shrunk during archiving....
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 12 May 2005 15:39:21 +0000 (15:39 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 12 May 2005 15:39:21 +0000 (15:39 +0000)
src/create.c

index d8f0c765b04ff35544a4372d3cdf874eb1dfb8b8..3760ef69b56722c50ca6eb72cc823a0651e8d716 100644 (file)
@@ -886,9 +886,9 @@ dump_regular_file (int fd, struct tar_stat_info *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_stat_info *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;
        }
     }
This page took 0.0300049999999999 seconds and 4 git commands to generate.