diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-04-22 11:07:18 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-04-27 11:54:57 +0200 |
commit | a87c85f4011169541583fe5530b5c5d1ca7f5991 (patch) | |
tree | bb9e7b31570e96603fea13092b43a030b90a52a0 /Userland/Utilities | |
parent | f25123df6633803e9a69b912b12aa302150a979b (diff) | |
download | serenity-a87c85f4011169541583fe5530b5c5d1ca7f5991.zip |
unzip: Create parent directory before extracting files
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/unzip.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Utilities/unzip.cpp b/Userland/Utilities/unzip.cpp index fc5f61d955..5d1ed31d5f 100644 --- a/Userland/Utilities/unzip.cpp +++ b/Userland/Utilities/unzip.cpp @@ -27,6 +27,7 @@ static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet) outln(" extracting: {}", zip_member.name); return true; } + MUST(Core::Directory::create(LexicalPath(zip_member.name).parent(), Core::Directory::CreateDirectories::Yes)); auto new_file = Core::File::construct(zip_member.name); if (!new_file->open(Core::OpenMode::WriteOnly)) { warnln("Can't write file {}: {}", zip_member.name, new_file->error_string()); |