mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Hopefully fixed infinite recursion.
This commit is contained in:
parent
4a05288e71
commit
608545118a
|
@ -1,3 +1,9 @@
|
|||
April 13, 2013
|
||||
-Finally merged the unstable branch, which means better input everything!
|
||||
-Can now use multiple joysticks.
|
||||
-Can now remap keyboard input.
|
||||
-Hopefully prevented infinitely recursing symlinks.
|
||||
|
||||
March 28, 2013
|
||||
-Hopefully fixed bad joystick events at startup.
|
||||
|
||||
|
|
|
@ -88,20 +88,6 @@ void SystemData::launchGame(Window* window, GameData* game)
|
|||
window->init();
|
||||
}
|
||||
|
||||
bool SystemData::containsFolder(FolderData* root, const std::string& path)
|
||||
{
|
||||
for(int i = 0; i < root->getFileCount(); i++)
|
||||
{
|
||||
FileData* f = root->getFile(i);
|
||||
if(f->isFolder())
|
||||
{
|
||||
if(f->getPath() == path || containsFolder((FolderData*)f, path))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SystemData::populateFolder(FolderData* folder)
|
||||
{
|
||||
std::string folderPath = folder->getPath();
|
||||
|
@ -114,8 +100,10 @@ void SystemData::populateFolder(FolderData* folder)
|
|||
//make sure that this isn't a symlink to a thing we already have
|
||||
if(fs::is_symlink(folderPath))
|
||||
{
|
||||
if(containsFolder(mRootFolder, folderPath))
|
||||
//if this symlink resolves to somewhere that's at the beginning of our path, it's gonna recurse
|
||||
if(folderPath.find(fs::canonical(folderPath).string()) == 0)
|
||||
{
|
||||
LOG(LogWarning) << "Skipping infinitely recursive symlink \"" << folderPath << "\"";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ private:
|
|||
std::string mLaunchCommand;
|
||||
|
||||
void populateFolder(FolderData* folder);
|
||||
bool containsFolder(FolderData* folder, const std::string& path);
|
||||
|
||||
FolderData* mRootFolder;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue