check outputFilePath for windows

This commit is contained in:
liuyu 2020-11-13 17:30:08 +08:00 committed by yvette
parent 9c8828761d
commit e511e0d897
1 changed files with 6 additions and 5 deletions

View File

@ -74,15 +74,16 @@ int Flags::Init(int argc, const char **argv) {
return RET_INPUT_PARAM_INVALID;
}
if (this->outputFile.rfind('/') == this->outputFile.length() - 1) {
std::cerr << "INPUT ILLEGAL: outputFile must be a valid file path";
return RET_INPUT_PARAM_INVALID;
}
#ifdef _WIN32
replace(this->outputFile.begin(), this->outputFile.end(), '/', '\\');
#endif
if (this->outputFile.rfind('/') == this->outputFile.length() - 1 ||
this->outputFile.rfind('\\') == this->outputFile.length() - 1) {
std::cerr << "INPUT ILLEGAL: outputFile must be a valid file path";
return RET_INPUT_PARAM_INVALID;
}
if (this->fmkIn.empty()) {
std::cerr << "INPUT MISSING: fmk is necessary";
return RET_INPUT_PARAM_INVALID;