From: Juergen Spitzmueller Date: Thu, 15 Jun 2017 13:07:03 +0000 (+0200) Subject: Catch "! Incomplete \\ifx" error X-Git-Tag: 2.3.0beta1~241 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=39f23ac66b0264c517fec1c8043758e9555340b8;p=features.git Catch "! Incomplete \\ifx" error Fixes: #10666 --- diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 9d796ef573..f28ea344eb 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -785,7 +785,7 @@ int LaTeX::scanLogFile(TeXErrors & terr) if (contains(token, "LaTeX Error:")) retval |= LATEX_ERROR; - if (prefixIs(token, "! File ended while scanning")){ + if (prefixIs(token, "! File ended while scanning")) { if (prefixIs(token, "! File ended while scanning use of \\Hy@setref@link.")){ // bug 7344. We must rerun LaTeX if hyperref has been toggled. retval |= ERROR_RERUN; @@ -797,6 +797,12 @@ int LaTeX::scanLogFile(TeXErrors & terr) } } + if (prefixIs(token, "! Incomplete \\ifx")) { + // bug 10666. At this point its not clear we finish with error. + wait_for_error = desc; + continue; + } + if (prefixIs(token, "! Paragraph ended before \\Hy@setref@link was complete.")){ // bug 7344. We must rerun LaTeX if hyperref has been toggled. retval |= ERROR_RERUN; @@ -808,6 +814,7 @@ int LaTeX::scanLogFile(TeXErrors & terr) string errstr; int count = 0; errstr = wait_for_error; + wait_for_error.clear(); do { if (!getline(ifs, tmp)) break; @@ -923,6 +930,9 @@ int LaTeX::scanLogFile(TeXErrors & terr) from_local8bit("Missing glyphs!"), from_local8bit(token), child_name); + } else if (!wait_for_error.empty()) { + // We collect information until we know we have an error. + wait_for_error += token + '\n'; } } }