Simplify std::filesystem usage a little in Boot.cpp
If path_b is absolute, (path_a / path_b) will be the same as path_b.
This commit is contained in:
parent
fab15edb53
commit
9c33f658a5
|
@ -88,9 +88,7 @@ static std::vector<std::string> ReadM3UFile(const std::string& m3u_path,
|
||||||
if (!line.empty() && line.front() != '#') // Comments start with #
|
if (!line.empty() && line.front() != '#') // Comments start with #
|
||||||
{
|
{
|
||||||
#ifdef HAS_STD_FILESYSTEM
|
#ifdef HAS_STD_FILESYSTEM
|
||||||
const fs::path path_line = fs::u8path(line);
|
const std::string path_to_add = (fs::u8path(folder_path) / fs::u8path(line)).u8string();
|
||||||
const std::string path_to_add =
|
|
||||||
path_line.is_relative() ? (fs::u8path(folder_path) / path_line).u8string() : line;
|
|
||||||
#else
|
#else
|
||||||
const std::string path_to_add = line.front() != '/' ? folder_path + line : line;
|
const std::string path_to_add = line.front() != '/' ? folder_path + line : line;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue