fix FlushDirCache() doesn't flush everything (NormalizePath("") results in "/")
This commit is contained in:
@@ -576,24 +576,24 @@ void RageFileManager::GetLoadedDrivers( vector<DriverLocation> &Mounts )
|
|||||||
|
|
||||||
void RageFileManager::FlushDirCache( CString sPath )
|
void RageFileManager::FlushDirCache( CString sPath )
|
||||||
{
|
{
|
||||||
NormalizePath( sPath );
|
|
||||||
|
|
||||||
LockMut( *g_Mutex );
|
LockMut( *g_Mutex );
|
||||||
|
|
||||||
|
if( sPath == "" )
|
||||||
|
{
|
||||||
for( unsigned i = 0; i < g_Drivers.size(); ++i )
|
for( unsigned i = 0; i < g_Drivers.size(); ++i )
|
||||||
{
|
|
||||||
if( sPath.size() == 0 )
|
|
||||||
{
|
|
||||||
g_Drivers[i].driver->FlushDirCache( "" );
|
g_Drivers[i].driver->FlushDirCache( "" );
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
/* Flush a specific path. */
|
||||||
|
NormalizePath( sPath );
|
||||||
|
for( unsigned i = 0; i < g_Drivers.size(); ++i )
|
||||||
{
|
{
|
||||||
const CString path = g_Drivers[i].GetPath( sPath );
|
const CString path = g_Drivers[i].GetPath( sPath );
|
||||||
if( path.size() == 0 )
|
if( path.size() == 0 )
|
||||||
continue;
|
continue;
|
||||||
g_Drivers[i].driver->FlushDirCache( path );
|
g_Drivers[i].driver->FlushDirCache( path );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RageFileManager::FileType RageFileManager::GetFileType( CString sPath )
|
RageFileManager::FileType RageFileManager::GetFileType( CString sPath )
|
||||||
|
|||||||
Reference in New Issue
Block a user