From: Sergey Poznyakoff Date: Sun, 4 Apr 2004 09:26:11 +0000 (+0000) Subject: (extract_archive): Use sparse_member_p instead of GNUTYPE_SPARSE. X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=3030a247b1e0d4ab25261107bed5ff4afb644b84;p=chaz%2Ftar (extract_archive): Use sparse_member_p instead of GNUTYPE_SPARSE. --- diff --git a/src/extract.c b/src/extract.c index ec48305..0feb68c 100644 --- a/src/extract.c +++ b/src/extract.c @@ -510,6 +510,9 @@ maybe_recoverable (char *file_name, int *interdir_made) errno = EEXIST; return r; } + + case UNLINK_FIRST_OLD_FILES: + break; } case ENOENT: @@ -596,7 +599,6 @@ extract_archive (void) int openflag; mode_t mode; off_t size; - off_t file_size; int interdir_made = 0; char typeflag; char *file_name; @@ -643,11 +645,9 @@ extract_archive (void) /* Extract the archive entry according to its type. */ - typeflag = current_header->header.typeflag; - /*KLUDGE */ - if (current_format == POSIX_FORMAT - && current_stat_info.archive_file_size != current_stat_info.stat.st_size) - typeflag = GNUTYPE_SPARSE; + /* KLUDGE */ + typeflag = sparse_member_p (¤t_stat_info) ? + GNUTYPE_SPARSE : current_header->header.typeflag; switch (typeflag) { @@ -724,7 +724,7 @@ extract_archive (void) } extract_file: - if (typeflag == GNUTYPE_SPARSE) + if (current_stat_info.is_sparse) { sparse_extract_file (fd, ¤t_stat_info, &size); }