FilenameDB::ResolvePath doesn't accept . or ..
This commit is contained in:
@@ -130,6 +130,7 @@ int FilenameDB::GetFileHash( const CString &sPath )
|
||||
return fs->GetFileHash(Name);
|
||||
}
|
||||
|
||||
/* path should be fully collapsed, so we can operate in-place: no . or .. */
|
||||
bool FilenameDB::ResolvePath(CString &path)
|
||||
{
|
||||
if( path == "." || path == "" )
|
||||
@@ -153,6 +154,8 @@ bool FilenameDB::ResolvePath(CString &path)
|
||||
fs = GetFileSet( ret );
|
||||
|
||||
CString p = path.substr( begin, size );
|
||||
RAGE_ASSERT_M( p.size() != 1 || p[0] != '.', path ); // no .
|
||||
RAGE_ASSERT_M( p.size() != 2 || p[0] != '.' || p[1] != '.', path ); // no ..
|
||||
set<File>::iterator it = fs->files.find( File(p) );
|
||||
|
||||
/* If there were no matches, the path isn't found. */
|
||||
|
||||
Reference in New Issue
Block a user