diff --git a/changelog.txt b/changelog.txt index 060f76b1f..d078ec685 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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. diff --git a/src/SystemData.cpp b/src/SystemData.cpp index 1c1ac232d..ef63adc4a 100644 --- a/src/SystemData.cpp +++ b/src/SystemData.cpp @@ -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; } } diff --git a/src/SystemData.h b/src/SystemData.h index 17fdfd3f5..e3c6755d2 100644 --- a/src/SystemData.h +++ b/src/SystemData.h @@ -38,7 +38,6 @@ private: std::string mLaunchCommand; void populateFolder(FolderData* folder); - bool containsFolder(FolderData* folder, const std::string& path); FolderData* mRootFolder; };