]> git.lyx.org Git - features.git/commitdiff
Avoid an infinite loop
authorEnrico Forestieri <forenr@lyx.org>
Fri, 9 Feb 2018 22:35:33 +0000 (23:35 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Fri, 9 Feb 2018 22:42:24 +0000 (23:42 +0100)
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

index aaf8b229f89065c7925ac5c6cf38acceb151b950..112e62d1b2ed3164760dc91b52eb6703ab527eee 100644 (file)
@@ -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();
                                        }
                                }