void LaTeX::deleteFilesOnError() const
{
- // currently just a dummy function.
-
// What files do we have to delete?
// This will at least make latex do all the runs
// Also remove the aux file
FileName const aux(changeExtension(file.absFileName(), ".aux"));
aux.removeFile();
+
+ // Remove the output file, which is often generated even if error
+ output_file.removeFile();
}
// Write the dependencies to file.
head.write(depfile);
+ if (scanres & NO_OUTPUT) {
+ // A previous run could have left a PDF and since
+ // no PDF is created if NO_OUTPUT, we remove any
+ // existing PDF and temporary files so that an
+ // incorrect PDF is not displayed, which could otherwise
+ // happen if View is run again because the checksum will
+ // be the same so any lingering PDF will be viewed.
+ deleteFilesOnError();
+ }
LYXERR(Debug::LATEX, "Done.");
return scanres;
}
size_t len = j == string::npos
? token.substr(i + 1).length()
: j - i - 1;
- if (regex_match(token.substr(i + 1, len),
- sub, child_file)) {
+ string const substr = token.substr(i + 1, len);
+ if (regex_match(substr, sub, child_file)) {
string const name = sub.str(1);
child.push(make_pair(name, pnest));
i += len;