From 67a7a8af914ec6987975cf974eda28eb48018302 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Fri, 30 Oct 2020 01:32:09 -0500 Subject: [PATCH] Fix extraction directory making --- source/utils/extract.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/utils/extract.cpp b/source/utils/extract.cpp index 2a0390d..38cb3e5 100644 --- a/source/utils/extract.cpp +++ b/source/utils/extract.cpp @@ -25,6 +25,7 @@ */ #include "extract.hpp" +#include "files.hpp" #include "scriptUtils.hpp" #include #include @@ -79,12 +80,7 @@ Result extractArchive(const std::string &archivePath, const std::string &wantedF if (std::regex_search(entryName, match, std::regex(wantedFile))) { extractingFile = outputPath + match.suffix().str(); - /* make directories. */ - int substrPos = 1; - while(extractingFile.find("/", substrPos)) { - mkdir(extractingFile.substr(0, substrPos).c_str(), 0777); - substrPos = extractingFile.find("/", substrPos) + 1; - } + makeDirs(outputPath.c_str()); uint sizeLeft = archive_entry_size(entry);