]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeX.cpp
Fix broken layout file syntax
[lyx.git] / src / LaTeX.cpp
index ecd255f4eaec8431c4278006217812407c733f37..c9d32478d1ef108b2b5a54e57c5a2c2e9ed71142 100644 (file)
@@ -94,7 +94,7 @@ bool operator!=(AuxInfo const & a, AuxInfo const & o)
 
 LaTeX::LaTeX(string const & latex, OutputParams const & rp,
             FileName const & f, string const & p)
-       : cmd(latex), file(f), path(p), runparams(rp)
+       : cmd(latex), file(f), path(p), runparams(rp), biber(false)
 {
        num_errors = 0;
        if (prefixIs(cmd, "pdf")) { // Do we use pdflatex ?
@@ -996,7 +996,7 @@ bool completeFilename(string const & ff, DepTable & head)
 }
 
 
-int iterateLine(string const token, regex const reg, string const closing,
+int iterateLine(string const token, regex const reg, string const closing,
                int fragment_pos, DepTable & head)
 {
        smatch what;
@@ -1044,7 +1044,7 @@ int iterateLine(string const token, regex const reg, string const closing,
        // result = -1 means we did not find a fragment!
        int result = -1;
        int last_match_pos = -1;
-       if (token.find(last_match) != string::npos)
+       if (!last_match.empty() && token.find(last_match) != string::npos)
                last_match_pos = int(token.find(last_match));
        if (fragment) {
                if (last_match_pos > fragment_pos)
@@ -1054,6 +1054,7 @@ int iterateLine(string const token, regex const reg, string const closing,
        } else
                if (last_match_pos < fragment_pos)
                        result = fragment_pos;
+
        return result;
 }