mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
System: Ensure titles are sanitized for screenshots
This commit is contained in:
parent
41f40248d2
commit
3877486712
|
@ -4764,13 +4764,13 @@ bool System::SaveScreenshot(const char* filename, DisplayScreenshotMode mode, Di
|
|||
std::string auto_filename;
|
||||
if (!filename)
|
||||
{
|
||||
const std::string& name = System::GetGameTitle();
|
||||
const std::string sanitized_name = Path::SanitizeFileName(System::GetGameTitle());
|
||||
const char* extension = Settings::GetDisplayScreenshotFormatExtension(format);
|
||||
std::string basename;
|
||||
if (name.empty())
|
||||
if (sanitized_name.empty())
|
||||
basename = fmt::format("{}", GetTimestampStringForFileName());
|
||||
else
|
||||
basename = fmt::format("{} {}", name, GetTimestampStringForFileName());
|
||||
basename = fmt::format("{} {}", sanitized_name, GetTimestampStringForFileName());
|
||||
|
||||
auto_filename = fmt::format("{}" FS_OSPATH_SEPARATOR_STR "{}.{}", EmuFolders::Screenshots, basename, extension);
|
||||
|
||||
|
|
Loading…
Reference in a new issue