From 24828dbbb904a6e43ca61f41b21b80ff2a84fde2 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 11 Sep 2022 15:45:16 +0200 Subject: Fixed extracting files to current working directory --- ArchiveEx/dat.cpp | 5 +++-- 1 file 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 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}; -- cgit v1.1