]> git.lyx.org Git - lyx.git/blobdiff - src/Chktex.C
Almost fix 'make check'. The only remaining problem is an undefined
[lyx.git] / src / Chktex.C
index 09c48a7eabe1a45963a5e7d861c3439839d6df72..981999f303fb0c5b33275982cabc356d824e91ae 100644 (file)
 namespace lyx {
 
 using support::changeExtension;
+using support::FileName;
+using support::makeAbsPath;
 using support::onlyFilename;
 using support::split;
 using support::Systemcall;
 
 using std::getline;
 using std::string;
-using std::ifstream;
 
 
 Chktex::Chktex(string const & chktex, string const & f, string const & p)
@@ -62,7 +63,9 @@ int Chktex::scanLogFile(TeXErrors & terr)
 {
        int retval = 0;
 
-       string const tmp = onlyFilename(changeExtension(file, ".log"));
+       // FIXME: Find out whether onlyFilename() is really needed,
+       // or whether makeAbsPath(onlyFilename()) is a noop here
+       FileName const tmp(makeAbsPath(onlyFilename(changeExtension(file, ".log"))));
 
 #if USE_BOOST_FORMAT
        boost::basic_format<char_type> msg(_("ChkTeX warning id # %1$d"));
@@ -72,7 +75,7 @@ int Chktex::scanLogFile(TeXErrors & terr)
        docstring token;
        // FIXME UNICODE
        // We have no idea what the encoding of the error file is
-       idocfstream ifs(tmp.c_str());
+       idocfstream ifs(tmp.toFilesystemEncoding().c_str());
        while (getline(ifs, token)) {
                docstring srcfile;
                docstring line;