mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 19:15:41 +00:00
double bug in script name handling workaround (Fixes #1730)
This commit is contained in:
parent
9f6a2d00e8
commit
bbbf431ae3
3 changed files with 8 additions and 7 deletions
|
@ -112,6 +112,7 @@ namespace Compiler
|
|||
scanner.scan (mScriptParser);
|
||||
|
||||
mState = EndNameState;
|
||||
scanner.allowNameStartingwithDigit();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,12 @@ bool Compiler::QuickFileParser::parseName (const std::string& name, const TokenL
|
|||
|
||||
bool Compiler::QuickFileParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
|
||||
{
|
||||
if (keyword==Scanner::K_begin)
|
||||
{
|
||||
scanner.allowNameStartingwithDigit();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keyword==Scanner::K_end)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -314,12 +314,10 @@ namespace Compiler
|
|||
|
||||
bool Scanner::scanName (char c, std::string& name)
|
||||
{
|
||||
bool first = true;
|
||||
bool error = false;
|
||||
|
||||
name.clear();
|
||||
|
||||
putback (c);
|
||||
name += c;
|
||||
|
||||
while (get (c))
|
||||
{
|
||||
|
@ -352,13 +350,9 @@ namespace Compiler
|
|||
putback (c);
|
||||
break;
|
||||
}
|
||||
|
||||
if (first && (std::isdigit (c) || c=='`' || c=='-'))
|
||||
error = true;
|
||||
}
|
||||
|
||||
name += c;
|
||||
first = false;
|
||||
}
|
||||
|
||||
return !error;
|
||||
|
|
Loading…
Reference in a new issue