From 1bce241f67790a20ec9d5e6dd42e23235f311800 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Thu, 3 Mar 2022 09:20:03 -0800 Subject: [PATCH 1/2] Print error when unzipping fails to save a file Signed-off-by: Louise Poubel --- src/Zip.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Zip.cc b/src/Zip.cc index f4d5be81..7685eeb5 100644 --- a/src/Zip.cc +++ b/src/Zip.cc @@ -168,9 +168,17 @@ bool Zip::Extract(const std::string &_src, if (len < 0) ignerr << "Error reading " << sb.name << std::endl; else + { file.write(buf, len); - - igndbg << "Created file [" << dst << "]" << std::endl; + if (file.fail()) + { + ignerr << "Failed to write file [" << dst << "]" << std::endl; + } + else + { + igndbg << "Created file [" << dst << "]" << std::endl; + } + } delete[] buf; file.close(); From a42fd16c302db5e182ecf2f0fcbd9acbd4984d6d Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Thu, 3 Mar 2022 09:49:46 -0800 Subject: [PATCH 2/2] Shortcut directories Signed-off-by: Louise Poubel --- src/Zip.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Zip.cc b/src/Zip.cc index 7685eeb5..a4529f48 100644 --- a/src/Zip.cc +++ b/src/Zip.cc @@ -150,6 +150,7 @@ bool Zip::Extract(const std::string &_src, << "Do you have the right permissions?" << std::endl; return false; } + continue; } // Create and write the files.