File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -184,16 +184,21 @@ std::vector<fs::path> iter_directory(const fs::path &dirname, bool dironly) {
184184 }
185185
186186 if (fs::exists (current_directory)) {
187- for (auto &entry : fs::directory_iterator (
188- current_directory, fs::directory_options::follow_directory_symlink |
189- fs::directory_options::skip_permission_denied)) {
190- if (!dironly || entry.is_directory ()) {
191- if (dirname.is_absolute ()) {
192- result.push_back (entry.path ());
193- } else {
194- result.push_back (fs::relative (entry.path ()));
187+ try {
188+ for (auto &entry : fs::directory_iterator (
189+ current_directory, fs::directory_options::follow_directory_symlink |
190+ fs::directory_options::skip_permission_denied)) {
191+ if (!dironly || entry.is_directory ()) {
192+ if (dirname.is_absolute ()) {
193+ result.push_back (entry.path ());
194+ } else {
195+ result.push_back (fs::relative (entry.path ()));
196+ }
195197 }
196198 }
199+ } catch (std::exception& e) {
200+ // not a directory
201+ // do nothing
197202 }
198203 }
199204
You can’t perform that action at this time.
0 commit comments