summaryrefslogtreecommitdiffstats
path: root/decode.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:43:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:43:28 +0000
commite0c798fd4f336deba0ac88c5f71418dda624bd2e (patch)
tree220a8f28beadbd5b80a0c6d7c1155eb842e77a99 /decode.cc
parentAdding upstream version 0.19. (diff)
downloadtarlz-e0c798fd4f336deba0ac88c5f71418dda624bd2e.tar.xz
tarlz-e0c798fd4f336deba0ac88c5f71418dda624bd2e.zip
Adding upstream version 0.21.upstream/0.21
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--decode.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/decode.cc b/decode.cc
index bc1794d..6c7d0ff 100644
--- a/decode.cc
+++ b/decode.cc
@@ -20,14 +20,9 @@
#include <algorithm>
#include <cctype>
#include <cerrno>
-#include <climits>
#include <cstdio>
#include <cstdlib>
-#include <cstring>
-#include <string>
-#include <vector>
-#include <pthread.h> // for tarlz.h
-#include <stdint.h>
+#include <stdint.h> // for lzlib.h
#include <unistd.h>
#include <utime.h>
#include <sys/stat.h>
@@ -37,8 +32,8 @@
#endif
#include <lzlib.h>
-#include "arg_parser.h"
#include "tarlz.h"
+#include "arg_parser.h"
#include "lzip_index.h"
#include "archive_reader.h"
@@ -454,10 +449,12 @@ int decode( const Cl_options & cl_opts )
extended.fill_from_ustar( header ); // copy metadata from header
+ // members without name are skipped except when listing
if( check_skip_filename( cl_opts, name_pending, extended.path().c_str() ) )
retval = skip_member( ar, extended );
else if( cl_opts.program_mode == m_list )
retval = list_member( ar, extended, header );
+ else if( extended.path().empty() ) retval = skip_member( ar, extended );
else if( cl_opts.program_mode == m_diff )
retval = compare_member( cl_opts, ar, extended, header );
else retval = extract_member( cl_opts, ar, extended, header );