fix #2873: if --pattern is used, default to not extracting
The extraction algorithm has a state (bool) indicating whether we're currently in a positive or negative match which has always been initialized to true at the beginning, but when the user provides a `--pattern` argument we need to start out with a negative match. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -27,6 +27,7 @@ pub fn extract_archive<T, F>(
|
||||
mut decoder: pxar::decoder::Decoder<T>,
|
||||
destination: &Path,
|
||||
match_list: &[MatchEntry],
|
||||
extract_match_default: bool,
|
||||
feature_flags: Flags,
|
||||
allow_existing_dirs: bool,
|
||||
mut callback: F,
|
||||
@ -69,7 +70,7 @@ where
|
||||
);
|
||||
|
||||
let mut match_stack = Vec::new();
|
||||
let mut current_match = true;
|
||||
let mut current_match = extract_match_default;
|
||||
while let Some(entry) = decoder.next() {
|
||||
use pxar::EntryKind;
|
||||
|
||||
|
Reference in New Issue
Block a user