Browse Source

!8584 check outputFilePath for windows

From: @lyvette
Reviewed-by: @hangangqiang,@zhanghaibo5
Signed-off-by: @hangangqiang
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
bb338f47cf
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      mindspore/lite/tools/converter/converter_flags.cc

+ 6
- 5
mindspore/lite/tools/converter/converter_flags.cc 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;


Loading…
Cancel
Save