1
0
mirror of synced 2025-01-19 01:24:15 +01:00

fix: Invalid paths being added to the default paths on Linux (#644)

* do not iterate over XDG home dir

* fixed typo

* use push_back

* same fix for getConfigPaths
This commit is contained in:
iTrooz_ 2022-08-03 19:52:02 +02:00 committed by GitHub
parent 90d243e0ba
commit 47166db166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,11 +130,10 @@ namespace hex::fs {
#elif defined(OS_LINUX)
auto dataDirs = xdg::DataDirs();
auto dataDirsHome = xdg::DataHomeDir();
paths.push_back(xdg::DataHomeDir());
auto dataDirs = xdg::DataDirs();
std::copy(dataDirs.begin(), dataDirs.end(), std::back_inserter(paths));
std::copy(dataDirsHome.begin(), dataDirsHome.end(), std::back_inserter(paths));
#endif
@ -159,11 +158,10 @@ namespace hex::fs {
#elif defined(OS_LINUX)
std::vector<std::fs::path> paths;
auto configDirs = xdg::ConfigDirs();
auto configDirsHome = xdg::ConfigHomeDir();
paths.push_back(xdg::DataHomeDir());
std::copy(configDirs.begin(), configDirs.end(), std::back_inserter(paths));
std::copy(configDirsHome.begin(), configDirsHome.end(), std::back_inserter(paths));
auto dataDirs = xdg::DataDirs();
std::copy(dataDirs.begin(), dataDirs.end(), std::back_inserter(paths));
return paths;
#endif