summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.18.2/busybox-1.18.2-tar.patch
blob: 5d5f721b72970f538a603daa26cfb1f4ac14822c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- busybox-1.18.2/archival/tar.c
+++ busybox-1.18.2-tar/archival/tar.c
@@ -1037,8 +1037,10 @@ int tar_main(int argc UNUSED_PARAM, char
 			tar_handle->src_fd = tar_fd;
 			tar_handle->seek = seek_by_read;
 		} else {
-			if (ENABLE_FEATURE_TAR_AUTODETECT && flags == O_RDONLY) {
-				get_header_ptr = get_header_tar;
+			if (ENABLE_FEATURE_TAR_AUTODETECT
+			 && flags == O_RDONLY
+			 && get_header_ptr == get_header_tar
+			) {
 				tar_handle->src_fd = open_zipped(tar_filename);
 				if (tar_handle->src_fd < 0)
 					bb_perror_msg_and_die("can't open '%s'", tar_filename);