diff options
Diffstat (limited to 'ArchiveEx')
-rw-r--r-- | ArchiveEx/dat.cpp | 5 |
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}; |