]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeX.C
* output_plaintext.C: cosmetics in comment: line length cannot be < 0
[lyx.git] / src / LaTeX.C
index d7f56bb5303c25646a3bd7886b4af4e821c98757..b8caf83b607aa2bf65056589af6a3ad41688edc2 100644 (file)
@@ -184,7 +184,7 @@ int LaTeX::run(TeXErrors & terr)
        bool rerun = false; // rerun requested
 
        // The class LaTeX does not know the temp path.
-       theBufferList().updateIncludedTeXfiles(getcwd(), runparams);
+       theBufferList().updateIncludedTeXfiles(getcwd().absFilename(), runparams);
 
        // Never write the depfile if an error was encountered.
 
@@ -481,6 +481,9 @@ void LaTeX::scanAuxFile(FileName const & file, Aux_Info & aux_info)
        while (getline(ifs, token)) {
                token = rtrim(token, "\r");
                smatch sub;
+               // FIXME UNICODE: We assume that citation keys and filenames
+               // in the aux file are in the file system encoding.
+               token = to_utf8(from_filesystem8bit(token));
                if (regex_match(token, sub, reg1)) {
                        string data = sub.str(1);
                        while (!data.empty()) {
@@ -512,7 +515,7 @@ void LaTeX::scanAuxFile(FileName const & file, Aux_Info & aux_info)
                        aux_info.styles.insert(style);
                } else if (regex_match(token, sub, reg4)) {
                        string const file2 = sub.str(1);
-                       scanAuxFile(FileName(makeAbsPath(file2)), aux_info);
+                       scanAuxFile(makeAbsPath(file2), aux_info);
                }
        }
 }
@@ -682,10 +685,14 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                                }
                                if (line_count <= 5) {
                                        // FIXME UNICODE
-                                       // We have no idea what the encoding of the log file is
-                                       // (probably pure ascii, but maybe some localized
-                                       // latex compilers or packages exist)
-                                       terr.insertError(line, from_utf8(desc), from_utf8(errstr));
+                                       // We have no idea what the encoding of
+                                       // the log file is.
+                                       // It seems that the output from the
+                                       // latex compiler itself is pure ASCII,
+                                       // but it can include bits from the
+                                       // document, so whatever encoding we
+                                       // assume here it can be wrong.
+                                       terr.insertError(line, from_local8bit(desc), from_local8bit(errstr));
                                        ++num_errors;
                                }
                        }
@@ -809,7 +816,7 @@ void LaTeX::deplog(DepTable & head)
        // This line is not present if no toc should be created.
        static regex miktexTocReg("\\\\tf@toc=\\\\write.*");
 
-       FileName const fn = FileName(makeAbsPath(logfile));
+       FileName const fn(makeAbsPath(logfile));
        ifstream ifs(fn.toFilesystemEncoding().c_str());
        while (ifs) {
                // Ok, the scanning of files here is not sufficient.
@@ -832,6 +839,10 @@ void LaTeX::deplog(DepTable & head)
 
                smatch sub;
 
+               // FIXME UNICODE: We assume that the file names in the log
+               // file are in the file system encoding.
+               token = to_utf8(from_filesystem8bit(token));
+
                if (regex_match(token, sub, reg1)) {
                        static regex reg1_1("\\(([^()]+)");
                        smatch what;