summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tar/read.c')
-rw-r--r--usr.bin/tar/read.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/tar/read.c b/usr.bin/tar/read.c
index 4763b13..dead37a 100644
--- a/usr.bin/tar/read.c
+++ b/usr.bin/tar/read.c
@@ -106,7 +106,10 @@ read_archive(struct bsdtar *bsdtar, char mode)
include_from_file(bsdtar, bsdtar->names_from_file);
a = archive_read_new();
- archive_read_support_compression_all(a);
+ if (bsdtar->compress_program != NULL)
+ archive_read_support_compression_program(a, bsdtar->compress_program);
+ else
+ archive_read_support_compression_all(a);
archive_read_support_format_all(a);
if (archive_read_open_file(a, bsdtar->filename,
bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block :
@@ -294,7 +297,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
/* Use uname if it's present, else uid. */
p = archive_entry_uname(entry);
if ((p == NULL) || (*p == '\0')) {
- sprintf(tmp, "%d ", st->st_uid);
+ sprintf(tmp, "%lu ", (unsigned long)st->st_uid);
p = tmp;
}
w = strlen(p);
@@ -308,7 +311,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
fprintf(out, "%s", p);
w = strlen(p);
} else {
- sprintf(tmp, "%d", st->st_gid);
+ sprintf(tmp, "%lu", (unsigned long)st->st_gid);
w = strlen(tmp);
fprintf(out, "%s", tmp);
}
@@ -319,9 +322,9 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
* If gs_width is too small, grow it.
*/
if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
- sprintf(tmp, "%d,%u",
- major(st->st_rdev),
- (unsigned)minor(st->st_rdev)); /* ls(1) also casts here. */
+ sprintf(tmp, "%lu,%lu",
+ (unsigned long)major(st->st_rdev),
+ (unsigned long)minor(st->st_rdev)); /* ls(1) also casts here. */
} else {
/*
* Note the use of platform-dependent macros to format
OpenPOWER on IntegriCloud