Fix bug #8089: Handle spaces at the end of the stream

If the stream is good (i.e. there are still tokens) and we expect an
argument, we call getArg(). However, if there are only spaces, the stream
suddenly isn't good anymore after 'skipSpaces' and we would get an error
when calling 'getChar'. Therefore we have to check whether the stream is
still good.
This commit is contained in:
Vincent van Ravesteijn 2012-05-02 13:41:09 +02:00
parent 1ef930c058
commit 26dcfcd343

View File

@ -544,9 +544,12 @@ char_type Parser::getChar()
docstring Parser::getArg(char_type left, char_type right)
{
docstring result;
skipSpaces();
docstring result;
if (!good())
return result;
char_type c = getChar();
if (c != left)