The branch, master has been updated
via 26dcfcd34374f86562af56dfe5f858d10ea587db (commit)
via 1ef930c05826340d7497d6994338f6d63772de5f (commit)
from e90cd4180e0ee2a23a25f08fa97c9cee0d2557f8 (commit)
- Log -----------------------------------------------------------------
commit 26dcfcd34374f86562af56dfe5f858d10ea587db
Author: Vincent van Ravesteijn <[email protected]>
Date: Wed May 2 13:41:09 2012 +0200
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.
diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index ad804e1..df71694 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -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)
commit 1ef930c05826340d7497d6994338f6d63772de5f
Author: Vincent van Ravesteijn <[email protected]>
Date: Wed May 2 13:37:32 2012 +0200
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.
diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index b3f1bca..ad804e1 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -536,7 +536,6 @@ char_type Parser::getChar()
{
if (!good()) {
error("The input stream is not well...");
- putback();
return 0;
}
return tokens_[pos_++].character();
-----------------------------------------------------------------------
Summary of changes:
src/mathed/MathParser.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
The LyX Source Repository