From 0bed6e565b1c583667d134819819913107f6d582 Mon Sep 17 00:00:00 2001 From: gibbed Date: Thu, 18 Jul 2019 18:37:47 -0500 Subject: [PATCH] [Base/GPU] Fix some usage of xe::find_base_path. --- src/xenia/base/filesystem.cc | 2 +- src/xenia/gpu/trace_writer.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/base/filesystem.cc b/src/xenia/base/filesystem.cc index 3eb06757d..a24bbaf85 100644 --- a/src/xenia/base/filesystem.cc +++ b/src/xenia/base/filesystem.cc @@ -99,7 +99,7 @@ std::string CanonicalizePath(const std::string& original_path) { bool CreateParentFolder(const std::wstring& path) { auto fixed_path = xe::fix_path_separators(path, xe::kWPathSeparator); auto base_path = xe::find_base_path(fixed_path, xe::kWPathSeparator); - if (base_path.size() && !PathExists(base_path)) { + if (!base_path.empty() && !PathExists(base_path)) { return CreateFolder(base_path); } else { return true; diff --git a/src/xenia/gpu/trace_writer.cc b/src/xenia/gpu/trace_writer.cc index 819029b3d..e41f82643 100644 --- a/src/xenia/gpu/trace_writer.cc +++ b/src/xenia/gpu/trace_writer.cc @@ -32,7 +32,9 @@ bool TraceWriter::Open(const std::wstring& path, uint32_t title_id) { auto canonical_path = xe::to_absolute_path(path); auto base_path = xe::find_base_path(canonical_path); - xe::filesystem::CreateFolder(base_path); + if (!base_path.empty()) { + xe::filesystem::CreateFolder(base_path); + } file_ = xe::filesystem::OpenFile(canonical_path, "wb"); if (!file_) {