[Base] Fix infinite recursion on Posix filesystem
When listing all files in a folder, ignore hidden files (which start with a dot). This prevents parsing ".." as a folder to enter, thus going back one level and entering an infinite loop of folders to parse.
This commit is contained in:
parent
451c1a7d75
commit
bec9c387be
|
@ -219,6 +219,10 @@ std::vector<FileInfo> ListFiles(const std::filesystem::path& path) {
|
|||
while (auto ent = readdir(dir)) {
|
||||
FileInfo info;
|
||||
|
||||
if (ent->d_name[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
|
||||
info.name = ent->d_name;
|
||||
struct stat st;
|
||||
stat((path / info.name).c_str(), &st);
|
||||
|
|
Loading…
Reference in New Issue