commit 8e8b3f610495493f4f1bff3f4a0ff48f4eab4539
Author: Enrico Forestieri <for...@lyx.org>
Date:   Fri Feb 9 23:35:33 2018 +0100

    Avoid an infinite loop
    
    When pasting "\big" without any following delimiter, avoid
    processing the same token again and again. For unknown reasons,
    the delim docstring turns out to always be not empty: even when
    it simply contains a '0' (no delimiter follows), its length is 1.
    
    Fixes bug #11027.
---
 src/mathed/MathParser.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index aaf8b22..112e62d 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -2000,7 +2000,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                                        new 
InsetMathBig(t.cs(), delim)));
                                        else {
                                                
cell->push_back(createInsetMath(t.cs(), buf));
-                                               putback();
+                                               // For some reason delim.empty()
+                                               // is always false here
+                                               if (delim.at(0))
+                                                       putback();
                                        }
                                }
 

Reply via email to