]> git.lyx.org Git - features.git/commitdiff
Catch "! Incomplete \\ifx" error
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 15 Jun 2017 13:07:03 +0000 (15:07 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 15 Jun 2017 13:07:03 +0000 (15:07 +0200)
Fixes: #10666
src/LaTeX.cpp

index 9d796ef5732d577e3d6ca5f4ee328ea8d920eddf..f28ea344ebcffbf35a96874e1537818ffabacaf4 100644 (file)
@@ -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';
                        }
                }
        }