#include "support/TempFile.h"
#include <fstream>
+#include <iomanip>
+#include <sstream>
using namespace std;
using namespace lyx::support;
LYXERR(Debug::LYXVC, "LyXVC::RCS: scanMaster: " << master_);
ifstream ifs(master_.toFilesystemEncoding().c_str());
+ // limit the size of strings we read to avoid memory problems
+ ifs >> setw(65636);
string token;
bool read_enough = false;
bool RCS::checkInEnabled()
{
- return owner_ && !owner_->isReadonly();
+ return owner_ && !owner_->hasReadonlyFlag();
}
bool RCS::checkOutEnabled()
{
- return owner_ && owner_->isReadonly();
+ return owner_ && owner_->hasReadonlyFlag();
}
bool RCS::undoLastEnabled()
{
- return true;
+ return owner_->hasReadonlyFlag();
}
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
+ default:
+ break;
}
return string();
if (contains(line, tmpf)) {
// Ok extract the fields.
smatch sm;
-
- // false positive from coverity
- // coverity[CHECKED_RETURN]
- regex_match(line, sm, reg);
+ if (!regex_match(line, sm, reg)) {
+ LYXERR(Debug::LYXVC, "\t Cannot parse line. Skipping.");
+ continue;
+ }
//sm[0]; // whole matched string
//sm[1]; // filename
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
+ default:
+ break;
}
}
return string();
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
FileName(owner_->filePath()));
- // Lock error messages go unfortunately on stderr and are unreachible this way.
+ // Lock error messages go unfortunately on stderr and are unreachable this way.
ifstream ifs(tmpf.toFilesystemEncoding().c_str());
string line;
while (ifs) {
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
-
+ default:
+ break;
}
return string();
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
-
+ default:
+ break;
}
return string();