From 6e0550d46b3192c9a1a5df4ac04ceda6f0ba3834 Mon Sep 17 00:00:00 2001 From: DrChat Date: Sun, 17 Dec 2017 15:17:44 -0600 Subject: [PATCH] [GPU] Strip the extension from .xtr files when choosing the output path. --- src/xenia/gpu/trace_dump.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/xenia/gpu/trace_dump.cc b/src/xenia/gpu/trace_dump.cc index 262d4e6f7..58f32af2b 100644 --- a/src/xenia/gpu/trace_dump.cc +++ b/src/xenia/gpu/trace_dump.cc @@ -97,9 +97,17 @@ int TraceDump::Main(const std::vector& args) { if (output_path.empty()) { base_output_path_ = xe::fix_path_separators(xe::to_wstring(FLAGS_trace_dump_path)); - base_output_path_ = - xe::join_paths(base_output_path_, - xe::find_name_from_path(xe::fix_path_separators(path))); + + std::wstring output_name = + xe::find_name_from_path(xe::fix_path_separators(path)); + + // Strip the extension from the filename. + auto last_dot = output_name.find_last_of(L"."); + if (last_dot != std::string::npos) { + output_name = output_name.substr(0, last_dot); + } + + base_output_path_ = xe::join_paths(base_output_path_, output_name); } else { base_output_path_ = xe::fix_path_separators(output_path); }