From 334a6ee707ca05705b78e445cc099da72efb0fc3 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Tue, 19 Feb 2008 05:54:24 +0000 Subject: [PATCH] Simplify file type setting. --- lib/libarchive/archive_read_support_format_ar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libarchive/archive_read_support_format_ar.c b/lib/libarchive/archive_read_support_format_ar.c index 0094a3481c6..5ce14b9d4ed 100644 --- a/lib/libarchive/archive_read_support_format_ar.c +++ b/lib/libarchive/archive_read_support_format_ar.c @@ -268,8 +268,7 @@ archive_read_format_ar_read_header(struct archive_read *a, /* This must come before any call to _read_ahead. */ ar_parse_common_header(ar, entry, h); archive_entry_copy_pathname(entry, filename); - archive_entry_set_mode(entry, - S_IFREG | (archive_entry_mode(entry) & 0777)); + archive_entry_set_filetype(entry, AE_IFREG); /* Get the size of the filename table. */ number = ar_atol10(h + AR_size_offset, AR_size_size); if (number > SIZE_MAX) { @@ -375,8 +374,7 @@ archive_read_format_ar_read_header(struct archive_read *a, /* Parse the time, owner, mode, size fields. */ r = ar_parse_common_header(ar, entry, h); /* Force the file type to a regular file. */ - archive_entry_set_mode(entry, - S_IFREG | (archive_entry_mode(entry) & 0777)); + archive_entry_set_filetype(entry, AE_IFREG); return (r); }