]> git.lyx.org Git - features.git/commit
Fix bug #8089: Handle spaces at the end of the stream
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 2 May 2012 11:37:32 +0000 (13:37 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 2 May 2012 16:24:24 +0000 (18:24 +0200)
commit2e771bf78d982b33a8789183a03319a932b569eb
treeaeb8b3ab0917059cfa08e5aade62318fbeca52db
parentdb5848095007c06048e7e426a0347f6eca051e00
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.

MathParser: Do not rewind the stream if we can't read from it

If the stream is not good, we don't need to 'putback', because we didn't
read anything yet. If we now do rewind the stream, we are asking for
problems as in bug #8089.

This was introduced in [3cafb856\lyxgit] to fix bug #4318.

(cherry picked from commit 26dcfcd34374f86562af56dfe5f858d10ea587db)
(cherry picked from commit 1ef930c05826340d7497d6994338f6d63772de5f)
src/mathed/MathParser.cpp
status.20x