]> git.lyx.org Git - features.git/commitdiff
MathParser: Do not rewind the stream if we can't read from it
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 12:40:14 +0000 (14:40 +0200)
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.

src/mathed/MathParser.cpp

index b3f1bca76b64cabbfcb33b9f8d879503bc15aca3..ad804e1f84bb3f9af1ec17337ac90b60a67f01be 100644 (file)
@@ -536,7 +536,6 @@ char_type Parser::getChar()
 {
        if (!good()) {
                error("The input stream is not well...");
-               putback();
                return 0;
        }
        return tokens_[pos_++].character();