Checking version for cached files so older versions cannot sneak through on upgrading of format.

meow-7.2.2
Ima Mechanique 2014-02-05 16:29:43 +00:00
parent 566b10e225
commit 5551e8f04c
1 changed files with 20 additions and 7 deletions

View File

@ -371,6 +371,10 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD()
<< "Trying to open cached or default keyword file ;-)"
<< LL_ENDL;
// Is this the right thing to do, or should we leave the old content
// even if it isn't entirely accurate anymore?
sKeywordsXml = LLSD().emptyMap();
LLSD content;
llifstream file;
file.open(mFullFileSpec);
@ -379,16 +383,25 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD()
sLoaded = (bool)LLSDSerialize::fromXML(content, file);
if (!sLoaded)
{
LL_ERRS("SyntaxLSL") << "Unable to deserialise file: " << mFullFileSpec << LL_ENDL;
// Is this the right thing to do, or should we leave the old content
// even if it isn't entirely accurate anymore?
sKeywordsXml = LLSD().emptyMap();
LL_ERRS("SyntaxLSL")
<< "Unable to deserialise file: "
<< mFullFileSpec << LL_ENDL;
}
else
{
sKeywordsXml = content;
LL_INFOS("SyntaxLSL") << "Deserialised file: " << mFullFileSpec << LL_ENDL;
if (isSupportedVersion(content))
{
sKeywordsXml = content;
LL_INFOS("SyntaxLSL")
<< "Deserialised file: " << mFullFileSpec << LL_ENDL;
}
else
{
LLSyntaxIdLSL::sLoaded = false;
LLSyntaxIdLSL::sLoadFailed = true;
LL_WARNS("SyntaxLSL")
<< "Unknown or unsupported version of syntax file." << LL_ENDL;
}
}
}
else