mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 17:11:39 +00:00
Merge pull request #2740 from Assumeru/empty-string
Ignore unterminated empty strings
This commit is contained in:
commit
4bb41a52bf
2 changed files with 23 additions and 0 deletions
|
@ -209,6 +209,7 @@
|
||||||
Bug #5313: Node properties of identical type are not applied in the correct order
|
Bug #5313: Node properties of identical type are not applied in the correct order
|
||||||
Bug #5326: Formatting issues in the settings.cfg
|
Bug #5326: Formatting issues in the settings.cfg
|
||||||
Bug #5328: Skills aren't properly reset for dead actors
|
Bug #5328: Skills aren't properly reset for dead actors
|
||||||
|
Bug #5345: Dopey Necromancy does not work due to a missing quote
|
||||||
Feature #1774: Handle AvoidNode
|
Feature #1774: Handle AvoidNode
|
||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
Feature #3025: Analogue gamepad movement controls
|
Feature #3025: Analogue gamepad movement controls
|
||||||
|
|
|
@ -282,6 +282,8 @@ namespace Compiler
|
||||||
|
|
||||||
if (!scanName (name))
|
if (!scanName (name))
|
||||||
return false;
|
return false;
|
||||||
|
else if(name.empty())
|
||||||
|
return true;
|
||||||
|
|
||||||
TokenLoc loc (mLoc);
|
TokenLoc loc (mLoc);
|
||||||
mLoc.mLiteral.clear();
|
mLoc.mLiteral.clear();
|
||||||
|
@ -368,6 +370,26 @@ namespace Compiler
|
||||||
mErrorHandler.warning ("string contains newline character, make sure that it is intended", mLoc);
|
mErrorHandler.warning ("string contains newline character, make sure that it is intended", mLoc);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
bool allWhitespace = true;
|
||||||
|
for (size_t i = 1; i < name.size(); i++)
|
||||||
|
{
|
||||||
|
//ignore comments
|
||||||
|
if (name[i] == ';')
|
||||||
|
break;
|
||||||
|
else if (name[i] != '\t' && name[i] != ' ' && name[i] != '\r')
|
||||||
|
{
|
||||||
|
allWhitespace = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (allWhitespace)
|
||||||
|
{
|
||||||
|
name.clear();
|
||||||
|
mLoc.mLiteral.clear();
|
||||||
|
mErrorHandler.warning ("unterminated empty string", mLoc);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
error = true;
|
error = true;
|
||||||
mErrorHandler.error ("incomplete string or name", mLoc);
|
mErrorHandler.error ("incomplete string or name", mLoc);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue