Not allowing / or spaces in file name prefix (#461)

This commit is contained in:
Dhanya Thattil
2022-05-18 12:37:44 +02:00
committed by GitHub
parent a4bd2f1be7
commit f3edd4dc56
2 changed files with 6 additions and 0 deletions

View File

@ -1244,6 +1244,9 @@ Result<std::string> Detector::getFileNamePrefix(Positions pos) const {
}
void Detector::setFileNamePrefix(const std::string &fname, Positions pos) {
if (fname.find_first_of("/ ") != std::string::npos) {
throw RuntimeError("Cannot set file name prefix with '/' or ' '");
}
pimpl->Parallel(&Module::setFileName, pos, fname);
}