fix g++ compile

This commit is contained in:
Glenn Maynard
2003-12-10 07:27:18 +00:00
parent 83701f9a9f
commit 9cef4460d4
+8 -3
View File
@@ -296,11 +296,16 @@ File *FilenameDB::GetFile( const CString &sPath )
SplitPath(sPath, Dir, Name);
FileSet &fs = GetFileSet( Dir );
set<File>::iterator i = fs.files.find( File(Name) );
if(i == fs.files.end())
set<File>::iterator it;
it = fs.files.find( File(Name) );
if( it == fs.files.end() )
return NULL;
return &*i;
/* Oops. &*it is a const File &, because you can't change the order
* of something once it's in a list. Cast away the const; we won't
* change the filename (used for the ordering), but the rest of the
* values are non-const. */
return const_cast<File *> (&*it);
}