int mult = 1;
if (extractNumber(script->up(), mult)) {
//lyxerr << "mult: " << mult << endl;
+ if (mult < 0 || mult > 1000) {
+ lyxerr << "Cannot differentiate less than 0 or more than 1000 times !" << endl;
+ continue;
+ }
for (int i = 0; i < mult; ++i)
diff->addDer(MathData(buf, dt + 1, st));
}
{
// In order to avoid parsing problems with command interpreters
// we pass input data through a file
- TempFile tempfile("casinput");
- FileName const cas_tmpfile = tempfile.name();
+ // Since the CAS is supposed to read the temp file we need
+ // to unlock it on windows (bug 10262).
+ unique_ptr<TempFile> tempfile(new TempFile("casinput"));
+ tempfile->setAutoRemove(false);
+ FileName const cas_tmpfile = tempfile->name();
+ tempfile.reset();
+
if (cas_tmpfile.empty()) {
lyxerr << "Warning: cannot create temporary file."
<< endl;
lyxerr << "calling: " << cmd
<< "\ninput: '" << data << "'" << endl;
cmd_ret const ret = runCommand(command);
+ cas_tmpfile.removeFile();
return ret.second;
}