mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-15 06:58:37 +02:00
Avoid forbidden characters when extracting disc partitions
We shouldn't try to create folder names that contain characters such as : or / since they are forbidden or have special meanings. (No officially released disc uses such characters, though.)
This commit is contained in:
@ -33,7 +33,7 @@ std::string DirectoryNameForPartitionType(u32 partition_type)
|
|||||||
static_cast<char>((partition_type >> 8) & 0xFF),
|
static_cast<char>((partition_type >> 8) & 0xFF),
|
||||||
static_cast<char>(partition_type & 0xFF)};
|
static_cast<char>(partition_type & 0xFF)};
|
||||||
if (std::all_of(type_as_game_id.cbegin(), type_as_game_id.cend(),
|
if (std::all_of(type_as_game_id.cbegin(), type_as_game_id.cend(),
|
||||||
[](char c) { return std::isprint(c, std::locale::classic()); }))
|
[](char c) { return std::isalnum(c, std::locale::classic()); }))
|
||||||
{
|
{
|
||||||
return "P-" + type_as_game_id;
|
return "P-" + type_as_game_id;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user