X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fextract.c;h=e62671e985fb32076623a5c7a06f6c273c4d9e0a;hb=d46025b23c5bbe31902ba4e902312ce8fe05ed63;hp=29b8e9b4f1cf60cfe854fb65ee10108bd1899f06;hpb=47e73c7a445527ae5b88873c12905c7fe1cfaf78;p=chaz%2Ftar diff --git a/src/extract.c b/src/extract.c index 29b8e9b..e62671e 100644 --- a/src/extract.c +++ b/src/extract.c @@ -572,7 +572,7 @@ extract_archive (void) if (verbose_option) print_header (¤t_stat_info, -1); - file_name = safer_name_suffix (current_stat_info.file_name, 0); + file_name = safer_name_suffix (current_stat_info.file_name, false); if (strip_path_elements) { size_t prefix_len = stripped_prefix_len (file_name, strip_path_elements); @@ -601,9 +601,10 @@ extract_archive (void) /* Extract the archive entry according to its type. */ typeflag = current_header->header.typeflag; - /*KLUDGE*/ - if (current_stat_info.archive_file_size != current_stat_info.stat.st_size) - typeflag = GNUTYPE_SPARSE; + /*KLUDGE */ + if (current_format == POSIX_FORMAT + && current_stat_info.archive_file_size != current_stat_info.stat.st_size) + typeflag = GNUTYPE_SPARSE; switch (typeflag) { @@ -860,7 +861,8 @@ extract_archive (void) again_link: { - char const *link_name = safer_name_suffix (current_stat_info.link_name, 1); + char const *link_name = safer_name_suffix (current_stat_info.link_name, + true); struct stat st1, st2; int e;