Skip to content

Commit

Permalink
Boot: Fix handling of M3U file paths containing backslashes
Browse files Browse the repository at this point in the history
Previously, if a user on Windows launched Dolphin from the command line
and specified a path to an M3U file and included backslashes in this path,
Dolphin would fail to resolve relative paths in the M3U file.
  • Loading branch information
JosJuice authored and OatmealDome committed Sep 3, 2023
1 parent 4d71f45 commit 05bdeb0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Core/Core/Boot/Boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ std::unique_ptr<BootParameters> BootParameters::GenerateFromFile(std::vector<std
{
ASSERT(!paths.empty());

for (std::string& path : paths)
UnifyPathSeparators(path);

const bool is_drive = Common::IsCDROMDevice(paths.front());
// Check if the file exist, we may have gotten it from a --elf command line
// that gave an incorrect file name
Expand All @@ -225,6 +228,9 @@ std::unique_ptr<BootParameters> BootParameters::GenerateFromFile(std::vector<std
if (paths.empty())
return {};

for (std::string& path : paths)
UnifyPathSeparators(path);

SplitPath(paths.front(), nullptr, nullptr, &extension);
Common::ToLower(&extension);
}
Expand Down

0 comments on commit 05bdeb0

Please sign in to comment.