]> Dogcows Code - chaz/tar/commitdiff
(dump_regular_file): Fix file padding in case of truncation to zero size.
authorSergey Poznyakoff <gray@gnu.org.ua>
Fri, 5 Oct 2007 11:20:27 +0000 (11:20 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Fri, 5 Oct 2007 11:20:27 +0000 (11:20 +0000)
src/create.c

index f54e346f777c4828002ac6e24a103d50415312b1..7be10d27e69c460d88478864c1aa01e6b4d89dd2 100644 (file)
@@ -1066,8 +1066,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
          return dump_status_short;
        }
       size_left -= count;
-      if (count)
-       set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
+      set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
 
       if (count != bufsize)
        {
@@ -1081,7 +1080,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
                 STRINGIFY_BIGINT (size_left, buf)));
          if (! ignore_failed_read_option) 
            exit_status = TAREXIT_DIFFERS;
-         pad_archive (size_left - (bufsize-count));
+         pad_archive (size_left - (bufsize - count));
          return dump_status_short;
        }
     }
This page took 0.028599 seconds and 4 git commands to generate.