add StripMacResourceForks(); hopefully prevents things like issue 178 ( http://ssc.ajworld.net/sm-ssc/bugtracker/view.php?id=178 ) from happening again
This commit is contained in:
@@ -33,6 +33,7 @@ void AnnouncerManager::GetAnnouncerNames( vector<RString>& AddTo )
|
|||||||
GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true );
|
GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true );
|
||||||
|
|
||||||
StripCvsAndSvn( AddTo );
|
StripCvsAndSvn( AddTo );
|
||||||
|
StripMacResourceForks( AddTo );
|
||||||
|
|
||||||
// strip out the empty announcer folder
|
// strip out the empty announcer folder
|
||||||
for( int i=AddTo.size()-1; i>=0; i-- )
|
for( int i=AddTo.size()-1; i>=0; i-- )
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ CharacterManager::CharacterManager()
|
|||||||
vector<RString> as;
|
vector<RString> as;
|
||||||
GetDirListing( CHARACTERS_DIR "*", as, true, true );
|
GetDirListing( CHARACTERS_DIR "*", as, true, true );
|
||||||
StripCvsAndSvn( as );
|
StripCvsAndSvn( as );
|
||||||
|
StripMacResourceForks( as );
|
||||||
|
|
||||||
bool FoundDefault = false;
|
bool FoundDefault = false;
|
||||||
for( unsigned i=0; i<as.size(); i++ )
|
for( unsigned i=0; i<as.size(); i++ )
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ void NoteSkinManager::RefreshNoteSkinData( const Game* pGame )
|
|||||||
GetDirListing( sBaseSkinFolder + "*", asNoteSkinNames, true );
|
GetDirListing( sBaseSkinFolder + "*", asNoteSkinNames, true );
|
||||||
|
|
||||||
StripCvsAndSvn( asNoteSkinNames );
|
StripCvsAndSvn( asNoteSkinNames );
|
||||||
|
StripMacResourceForks( asNoteSkinNames );
|
||||||
|
|
||||||
g_mapNameToData.clear();
|
g_mapNameToData.clear();
|
||||||
for( unsigned j=0; j<asNoteSkinNames.size(); j++ )
|
for( unsigned j=0; j<asNoteSkinNames.size(); j++ )
|
||||||
@@ -227,6 +228,7 @@ void NoteSkinManager::GetAllNoteSkinNamesForGame( const Game *pGame, vector<RStr
|
|||||||
RString sBaseSkinFolder = SpecialFiles::NOTESKINS_DIR + pGame->m_szName + "/";
|
RString sBaseSkinFolder = SpecialFiles::NOTESKINS_DIR + pGame->m_szName + "/";
|
||||||
GetDirListing( sBaseSkinFolder + "*", AddTo, true );
|
GetDirListing( sBaseSkinFolder + "*", AddTo, true );
|
||||||
StripCvsAndSvn( AddTo );
|
StripCvsAndSvn( AddTo );
|
||||||
|
StripMacResourceForks( AddTo );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1189,6 +1189,16 @@ void StripCvsAndSvn( vector<RString> &vs )
|
|||||||
RemoveIf( vs, CVSOrSVN );
|
RemoveIf( vs, CVSOrSVN );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool MacResourceFork( const RString& s )
|
||||||
|
{
|
||||||
|
return s.Left(2).EqualsNoCase("._");
|
||||||
|
}
|
||||||
|
|
||||||
|
void StripMacResourceForks( vector<RString> &vs )
|
||||||
|
{
|
||||||
|
RemoveIf( vs, MacResourceFork );
|
||||||
|
}
|
||||||
|
|
||||||
/* path is a .redir pathname. Read it and return the real one. */
|
/* path is a .redir pathname. Read it and return the real one. */
|
||||||
RString DerefRedir( const RString &_path )
|
RString DerefRedir( const RString &_path )
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-1
@@ -494,7 +494,8 @@ bool BeginsWith( const RString &sTestThis, const RString &sBeginning );
|
|||||||
bool EndsWith( const RString &sTestThis, const RString &sEnding );
|
bool EndsWith( const RString &sTestThis, const RString &sEnding );
|
||||||
RString URLEncode( const RString &sStr );
|
RString URLEncode( const RString &sStr );
|
||||||
|
|
||||||
void StripCvsAndSvn( vector<RString> &vs ); // remove all items that end in "cvs"
|
void StripCvsAndSvn( vector<RString> &vs ); // Removes various versioning system metafolders.
|
||||||
|
void StripMacResourceForks( vector<RString> &vs ); // Removes files starting with "._"
|
||||||
|
|
||||||
RString DerefRedir( const RString &sPath );
|
RString DerefRedir( const RString &sPath );
|
||||||
bool GetFileContents( const RString &sPath, RString &sOut, bool bOneLine = false );
|
bool GetFileContents( const RString &sPath, RString &sOut, bool bOneLine = false );
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ void ScreenOptionsExportPackage::BeginScreen()
|
|||||||
vector<RString> vs;
|
vector<RString> vs;
|
||||||
GetDirListing( SpecialFiles::COURSES_DIR + "*", vs, true, true );
|
GetDirListing( SpecialFiles::COURSES_DIR + "*", vs, true, true );
|
||||||
StripCvsAndSvn( vs );
|
StripCvsAndSvn( vs );
|
||||||
|
StripMacResourceForks( vs );
|
||||||
FOREACH_CONST( RString, vs, s )
|
FOREACH_CONST( RString, vs, s )
|
||||||
{
|
{
|
||||||
m_vsPossibleDirsToExport.push_back( *s );
|
m_vsPossibleDirsToExport.push_back( *s );
|
||||||
@@ -64,6 +65,7 @@ void ScreenOptionsExportPackage::BeginScreen()
|
|||||||
}
|
}
|
||||||
|
|
||||||
StripCvsAndSvn( m_vsPossibleDirsToExport );
|
StripCvsAndSvn( m_vsPossibleDirsToExport );
|
||||||
|
StripMacResourceForks( m_vsPossibleDirsToExport );
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<OptionRowHandler*> OptionRowHandlers;
|
vector<OptionRowHandler*> OptionRowHandlers;
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
|||||||
GetDirListing( sDir+"*", arrayGroupDirs, true );
|
GetDirListing( sDir+"*", arrayGroupDirs, true );
|
||||||
SortRStringArray( arrayGroupDirs );
|
SortRStringArray( arrayGroupDirs );
|
||||||
StripCvsAndSvn( arrayGroupDirs );
|
StripCvsAndSvn( arrayGroupDirs );
|
||||||
|
StripMacResourceForks( arrayGroupDirs );
|
||||||
|
|
||||||
FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/
|
FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/
|
||||||
{
|
{
|
||||||
@@ -241,6 +242,7 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
|||||||
vector<RString> arraySongDirs;
|
vector<RString> arraySongDirs;
|
||||||
GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true );
|
GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true );
|
||||||
StripCvsAndSvn( arraySongDirs );
|
StripCvsAndSvn( arraySongDirs );
|
||||||
|
StripMacResourceForks( arraySongDirs );
|
||||||
SortRStringArray( arraySongDirs );
|
SortRStringArray( arraySongDirs );
|
||||||
|
|
||||||
LOG->Trace("Attempting to load %i songs from \"%s\"", int(arraySongDirs.size()),
|
LOG->Trace("Attempting to load %i songs from \"%s\"", int(arraySongDirs.size()),
|
||||||
@@ -731,6 +733,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
|
|||||||
// Find all group directories in Courses dir
|
// Find all group directories in Courses dir
|
||||||
GetDirListing( *sDir + "*", vsCourseGroupNames, true, true );
|
GetDirListing( *sDir + "*", vsCourseGroupNames, true, true );
|
||||||
StripCvsAndSvn( vsCourseGroupNames );
|
StripCvsAndSvn( vsCourseGroupNames );
|
||||||
|
StripMacResourceForks( vsCourseGroupNames );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for courses both in COURSES_DIR and in subdirectories
|
// Search for courses both in COURSES_DIR and in subdirectories
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ void ThemeManager::GetThemeNames( vector<RString>& AddTo )
|
|||||||
{
|
{
|
||||||
GetDirListing( SpecialFiles::THEMES_DIR + "*", AddTo, true );
|
GetDirListing( SpecialFiles::THEMES_DIR + "*", AddTo, true );
|
||||||
StripCvsAndSvn( AddTo );
|
StripCvsAndSvn( AddTo );
|
||||||
|
StripMacResourceForks( AddTo );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeManager::GetSelectableThemeNames( vector<RString>& AddTo )
|
void ThemeManager::GetSelectableThemeNames( vector<RString>& AddTo )
|
||||||
@@ -462,6 +463,7 @@ void ThemeManager::RunLuaScripts( const RString &sMask )
|
|||||||
GetDirListing( sThemeDir + "Scripts/*", arrayScriptDirs, true );
|
GetDirListing( sThemeDir + "Scripts/*", arrayScriptDirs, true );
|
||||||
SortRStringArray( arrayScriptDirs );
|
SortRStringArray( arrayScriptDirs );
|
||||||
StripCvsAndSvn( arrayScriptDirs );
|
StripCvsAndSvn( arrayScriptDirs );
|
||||||
|
StripMacResourceForks( arrayScriptDirs );
|
||||||
FOREACH_CONST( RString, arrayScriptDirs, s ) // foreach dir in /Scripts/
|
FOREACH_CONST( RString, arrayScriptDirs, s ) // foreach dir in /Scripts/
|
||||||
{
|
{
|
||||||
// Find all Lua files in this directory, add them to asElementPaths
|
// Find all Lua files in this directory, add them to asElementPaths
|
||||||
|
|||||||
Reference in New Issue
Block a user