- LString tmp = ChangeExtension(file, ".log", true);
-
- if (!lex.setFile(tmp)) {
- // Unable to open file. Return at once
- return -1;
- }
+#if USE_BOOST_FORMAT
+ boost::basic_format<char_type> msg(_("ChkTeX warning id # %1$d"));
+#else
+ docstring const msg(_("ChkTeX warning id # "));
+#endif
+ docstring token;
+ // FIXME UNICODE
+ // We have no idea what the encoding of the error file is
+ idocfstream ifs(tmp.c_str());
+ while (getline(ifs, token)) {
+ docstring srcfile;
+ docstring line;
+ docstring pos;
+ docstring warno;
+ docstring warning;
+ token = split(token, srcfile, ':');
+ token = split(token, line, ':');
+ token = split(token, pos, ':');
+ token = split(token, warno, ':');
+ token = split(token, warning, ':');
+
+ int const lineno = convert<int>(line);
+
+#if USE_BOOST_FORMAT
+ msg % warno;
+ terr.insertError(lineno, msg.str(), warning);
+ msg.clear();
+#else
+ terr.insertError(lineno, msg + warno, warning);
+#endif