summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrChat <arkolbed@gmail.com>2017-12-17 15:17:44 -0600
committerDrChat <arkolbed@gmail.com>2017-12-17 15:17:44 -0600
commit6e0550d46b3192c9a1a5df4ac04ceda6f0ba3834 (patch)
treeae014296569887844d15ebe4912008c0a7fbd649
parentd4338a2c3f439e846188af547eb28644f7e31121 (diff)
[GPU] Strip the extension from .xtr files when choosing the output path.
-rw-r--r--src/xenia/gpu/trace_dump.cc14
1 files 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<std::wstring>& 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);
}