Fixed: Reusing CIFile to load from bnp and from regular files.

--HG--
branch : develop
This commit is contained in:
Nimetu 2019-04-29 14:10:19 +03:00
parent f065b7f747
commit 82f084982a

View file

@ -157,6 +157,14 @@ bool CIFile::open(const std::string &path, bool text)
close(); close();
if ((_IsInBigFile || _IsInXMLPackFile) && path.find('@') == string::npos)
{
// CIFile can be reused to load file from bnp and from regular files.
// Last open happened to be inside bnp and close() may not set _F to NULL.
// Opening regular file will fail as _F points to bnp file.
_F = NULL;
}
// can't open empty filename // can't open empty filename
if(path.empty ()) if(path.empty ())
return false; return false;