From 69e9887a1226d79c44fa638d94c1a9212640235c Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Thu, 12 Apr 2018 17:48:33 +0200 Subject: [PATCH] fix(elan-dist): ZipArchive: don't create directories as files --- src/elan-dist/src/component/package.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/elan-dist/src/component/package.rs b/src/elan-dist/src/component/package.rs index 1c0cb69..ca11836 100644 --- a/src/elan-dist/src/component/package.rs +++ b/src/elan-dist/src/component/package.rs @@ -176,6 +176,9 @@ impl<'a> ZipPackage<'a> { fn unpack_without_first_dir(archive: &mut ZipArchive, path: &Path) -> Result<()> { for i in 0..archive.len() { let mut entry = archive.by_index(i).chain_err(|| ErrorKind::ExtractingPackage)?; + if entry.name().ends_with('/') { + continue // skip directories + } let relpath = PathBuf::from(entry.name()); let mut components = relpath.components(); // Throw away the first path component