- // if any of the bib file has changed we don't have to
- // check the .aux file.
- if (dep.extchanged(".bib")
- || dep.extchanged(".bst")) return true;
-
- string aux = ChangeExtension(file, ".aux", true);
- ifstream ifs(aux.c_str());
- string token;
- LRegex reg1("\\\\bibdata{([^}]+)}");
- LRegex reg2("\\\\bibstyle{([^}]+)}");
- while (getline(ifs, token)) {
- if (reg1.exact_match(token)) {
- LRegex::SubMatches sub = reg1.exec(token);
- string data = LSubstring(token, sub[1].first,
- sub[1].second);
- string::size_type b;
- do {
- b = data.find_first_of(',', 0);
- string l;
- if (b == string::npos)
- l = data;
- else {
- l = data.substr( 0, b - 0);
- data.erase(0, b + 1);
- }
- string full_l =
- findtexfile(
- ChangeExtension(l, "bib", false), "bib");
- if (!full_l.empty()) {
- if (!dep.exist(full_l))
- return true;
- }
- } while (b != string::npos);
- } else if (reg2.exact_match(token)) {
- LRegex::SubMatches sub = reg2.exec(token);
- string style = LSubstring(token, sub[1].first,
- sub[1].second);
- // token is now the style file
- // pass it to the helper
- string full_l =
- findtexfile(
- ChangeExtension(style, "bst", false),
- "bst");
- if (!full_l.empty()) {
- if (!dep.exist(full_l))
- return true;
- }
- }
+ vector<Aux_Info> result;
+
+ result.push_back(scanAuxFile(file));
+
+ for (int i = 1; i < 1000; ++i) {
+ string file2 = ChangeExtension(file, "") + "." + tostr(i)
+ + ".aux";
+ FileInfo fi(file2);
+ if (!fi.exist())
+ break;
+ result.push_back(scanAuxFile(file2));