Game files that are actually recursive symlinks are now skipped during startup.

This commit is contained in:
Leon Styhre 2021-07-01 17:58:09 +02:00
parent 369c9cdd0f
commit 3a986b447d

View file

@ -278,6 +278,15 @@ bool SystemData::populateFolder(FileData* folder)
it != dirContent.cend(); it++) { it != dirContent.cend(); it++) {
filePath = *it; filePath = *it;
// Skip any recursive symlinks as those would hang the application at various places.
if (Utils::FileSystem::isSymlink(filePath)) {
if (Utils::FileSystem::resolveSymlink(filePath) ==
Utils::FileSystem::getFileName(filePath)) {
LOG(LogWarning) << "Skipped \"" << filePath << "\" as it's a recursive symlink";
continue;
}
}
// Skip hidden files and folders. // Skip hidden files and folders.
if (!showHiddenFiles && Utils::FileSystem::isHidden(filePath)) { if (!showHiddenFiles && Utils::FileSystem::isHidden(filePath)) {
LOG(LogDebug) << "SystemData::populateFolder(): Skipping hidden " << LOG(LogDebug) << "SystemData::populateFolder(): Skipping hidden " <<