void
search (Replacements& replacement_paths, boost::filesystem::path directory, int depth = 0)
{
- for (auto candidate: boost::filesystem::directory_iterator(directory)) {
+ boost::system::error_code ec;
+ for (auto candidate: boost::filesystem::directory_iterator(directory, ec)) {
if (boost::filesystem::is_regular_file(candidate.path())) {
for (auto& replacement: replacement_paths) {
for (auto& path: replacement.second) {
search (replacement_paths, candidate, depth + 1);
}
}
+
+ /* Just ignore errors when creating the directory_iterator; they can be triggered by things like
+ * macOS' love of creating random directories (see #2291).
+ */
}