#endif
#include <fstream>
-#include "support/filetools.h"
#include "LaTeX.h"
+#include "support/filetools.h"
+#include "support/os.h"
#include "support/FileInfo.h"
#include "debug.h"
#include "support/lyxlib.h"
// remove all ".bib" and ".bst" files.
dep.remove_files_with_extension(".bib");
dep.remove_files_with_extension(".bst");
- string aux = OnlyFilename(ChangeExtension(file, ".aux"));
+ //string aux = OnlyFilename(ChangeExtension(file, ".aux"));
for (vector<Aux_Info>::const_iterator it = bibtex_info.begin();
it != bibtex_info.end(); ++it) {
LRegex reg2("File: ([^ ]+).*");
LRegex reg3("No file ([^ ]+)\\..*");
LRegex reg4("\\\\openout[0-9]+.*=.*`([^ ]+)'\\..*");
+ // If an index should be created, MikTex does not write a line like
+ // \openout# = 'sample,idx'.
+ // but intstead only a line like this into the log:
+ // Writing index file sample.idx
+ LRegex reg5("Writing index file ([^ ]+).*");
LRegex unwanted("^.*\\.(aux|log|dvi|bbl|ind|glo)$");
ifstream ifs(logfile.c_str());
LRegex::SubMatches const & sub = reg4.exec(token);
foundfile = LSubstring(token, sub[1].first,
sub[1].second);
+ } else if (reg5.exact_match(token)) {
+ LRegex::SubMatches const & sub = reg5.exec(token);
+ foundfile = LSubstring(token, sub[1].first,
+ sub[1].second);
} else {
continue;
}
+ // convert from native os path to unix path
+ foundfile = os::internal_path(foundfile);
+
lyxerr[Debug::DEPEND] << "Found file: "
<< foundfile << endl;