diff --git a/src/pxar/sequential_decoder.rs b/src/pxar/sequential_decoder.rs index 89aa46bb..79ae2d53 100644 --- a/src/pxar/sequential_decoder.rs +++ b/src/pxar/sequential_decoder.rs @@ -697,13 +697,12 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F ) -> Result<(), Error> { let full_path = base_path.join(&relative_path); - (self.callback)(&full_path)?; - let head: CaFormatHeader = self.read_item()?; if head.htype == PXAR_FORMAT_HARDLINK { let (target, _offset) = self.read_hardlink(head.size)?; let target_path = base_path.join(&target); if let Some(_) = parent_fd { + (self.callback)(&full_path)?; hardlink(&target_path, &full_path)?; } return Ok(()); @@ -726,6 +725,10 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F } } + if fd.is_some() { + (self.callback)(&full_path)?; + } + match entry.mode as u32 & libc::S_IFMT { libc::S_IFDIR => self.restore_dir_sequential(base_path, relative_path, &full_path, fd, &entry, &filename, &child_pattern), libc::S_IFLNK => self.restore_symlink(fd, &full_path, &entry, &filename),