Skip to content
Permalink
Browse files

Merge pull request #8209 from JosJuice/filesystem-fix

Fix opening controller config when there is no profile directory
  • Loading branch information...
spycrab committed Jun 20, 2019
2 parents b11f630 + 63bb646 commit f08aa2d842e980471d41992e7949c97c9661432d
Showing with 13 additions and 9 deletions.
  1. +13 −9 Source/Core/Common/FileSearch.cpp
@@ -97,16 +97,20 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie
};
for (const auto& directory : directories)
{
if (recursive)
const fs::path directory_path = fs::u8path(directory);
if (fs::is_directory(directory_path)) // Can't create iterators for non-existant directories
{
// TODO use fs::directory_options::follow_directory_symlink ?
for (auto& entry : fs::recursive_directory_iterator(fs::u8path(directory)))
add_filtered(entry);
}
else
{
for (auto& entry : fs::directory_iterator(fs::u8path(directory)))
add_filtered(entry);
if (recursive)
{
// TODO use fs::directory_options::follow_directory_symlink ?
for (auto& entry : fs::recursive_directory_iterator(std::move(directory_path)))
add_filtered(entry);
}
else
{
for (auto& entry : fs::directory_iterator(std::move(directory_path)))
add_filtered(entry);
}
}
}

0 comments on commit f08aa2d

Please sign in to comment.
You can’t perform that action at this time.