summaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2006-03-08 12:21:39 +0000
committerLudovic Courtès <ludo@gnu.org>2006-03-08 12:21:39 +0000
commit3ff45223dddf4d31b336589498e0b31b8e703017 (patch)
treeae7be6971a611d248fd4939a526502400cbf653b /tar.c
parent482b4ca7291b1b66019392bda25f20ebed2a81e5 (diff)
Fixed value of `st_blocks' (Ben Asselstine).
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tar.c b/tar.c
index 31bf61ea3..40cbfb908 100644
--- a/tar.c
+++ b/tar.c
@@ -173,6 +173,10 @@ tar_header2stat (io_statbuf_t *st, tar_record_t *header)
}
//st->st_size = hstat.st_size;
st->st_size = from_oct (1 + 12, header->header.size);
+ if (st->st_size > 0)
+ st->st_blocks = ((st->st_size - 1) / 512) + 1;
+ else
+ st->st_blocks = 0;
st->st_mtime = from_oct (1 + 12, header->header.mtime);
st->st_atime = from_oct (1 + 12, header->header.atime);
st->st_ctime = from_oct (1 + 12, header->header.ctime);