summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-09-11 15:45:16 +0200
committerAki <please@ignore.pl>2022-09-11 15:45:16 +0200
commit24828dbbb904a6e43ca61f41b21b80ff2a84fde2 (patch)
tree639b2e09ac237821b47eeb77cfedefe3a75e4e5d
parenta40bfabfd1a6fd95b9b8d39db37bb08fbefff334 (diff)
downloadstarshatter-24828dbbb904a6e43ca61f41b21b80ff2a84fde2.zip
starshatter-24828dbbb904a6e43ca61f41b21b80ff2a84fde2.tar.gz
starshatter-24828dbbb904a6e43ca61f41b21b80ff2a84fde2.tar.bz2
Fixed extracting files to current working directory
-rw-r--r--ArchiveEx/dat.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ArchiveEx/dat.cpp b/ArchiveEx/dat.cpp
index dc0acc9..1dd7ea3 100644
--- a/ArchiveEx/dat.cpp
+++ b/ArchiveEx/dat.cpp
@@ -201,8 +201,9 @@ try {
if (0 > length)
throw ExtractError();
std::unique_ptr<std::uint8_t[]> buf{tmp};
- std::error_code err;
- fs::create_directories(path.parent_path(), err);
+ std::error_code err{};
+ if (path.has_parent_path())
+ fs::create_directories(path.parent_path(), err);
if (err)
throw ExtractError();
std::ofstream file{path};