Skip to content

Commit

Permalink
Fix failure when decomp output path is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
grunt-lucas committed Sep 9, 2023
1 parent bc2f47d commit 6c0321a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,14 @@ static void validateDecompileOutputs(PtContext &ctx, std::filesystem::path &outp
fmt::format("'{}' exists in output directory but is not a file", topPath.string()));
}

try {
std::filesystem::create_directories(outputPath);
}
catch (const std::exception &e) {
fatalerror(ctx.err, ctx.decompilerSrcPaths, ctx.decompilerConfig.mode,
fmt::format("could not create '{}': {}", outputPath.string(), e.what()));
if (!outputPath.empty()) {
try {
std::filesystem::create_directories(outputPath);
}
catch (const std::exception &e) {
fatalerror(ctx.err, ctx.decompilerSrcPaths, ctx.decompilerConfig.mode,
fmt::format("could not create '{}': {}", outputPath.string(), e.what()));
}
}
}

Expand Down

0 comments on commit 6c0321a

Please sign in to comment.