Added a step to RageFileManager::GetDirlisting to ignore OS X special files.

This commit is contained in:
Kyzentun Keeslala
2015-12-27 07:44:58 -07:00
parent 55bd774a4c
commit 25dd2bbef9
+16
View File
@@ -432,6 +432,22 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector<RString> &Add
UnreferenceAllDrivers( apDriverList );
// Remove files that start with ._ from the list because these are special
// OS X files that cause interference on other platforms. -Kyz
for(size_t i= iOldSize; i < AddTo.size(); ++i)
{
size_t last_slash= AddTo[i].rfind('/');
last_slash= (last_slash == string::npos) ? 0 : (last_slash+1);
if(last_slash < AddTo[i].size() - 1)
{
if(AddTo[i][last_slash] == '.' && AddTo[i][last_slash+1] == '_')
{
AddTo.erase(AddTo.begin() + i);
--i;
}
}
}
if( iDriversThatReturnedFiles > 1 )
{
/* More than one driver returned files. Remove duplicates (case-insensitively). */