From 9321bbd1f561f085513a984e2a23ed82468375af Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 16 Jun 2020 11:04:56 +0200 Subject: [PATCH] pxar: fix missing subdirectories in catalogs Signed-off-by: Wolfgang Bumiller --- src/pxar/create.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pxar/create.rs b/src/pxar/create.rs index e337b32f..c16c8a7f 100644 --- a/src/pxar/create.rs +++ b/src/pxar/create.rs @@ -486,7 +486,15 @@ impl<'a, 'b> Archiver<'a, 'b> { } mode::IFDIR => { let dir = Dir::from_fd(fd.into_raw_fd())?; - self.add_directory(encoder, dir, c_file_name, &metadata, stat) + + if let Some(ref mut catalog) = self.catalog { + catalog.start_directory(c_file_name)?; + } + let result = self.add_directory(encoder, dir, c_file_name, &metadata, stat); + if let Some(ref mut catalog) = self.catalog { + catalog.end_directory()?; + } + result } mode::IFSOCK => { if let Some(ref mut catalog) = self.catalog {