diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 6b0757df73..667f4ccd6d 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -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::iterator it = fs->files.find( File(p) ); /* If there were no matches, the path isn't found. */