Browse Source

!8896 fix cropper realpath bugs

From: @yeyunpeng2020
Reviewed-by: @hangangqiang,@HilbertDavid
Signed-off-by: @hangangqiang
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
59d15b7330
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      mindspore/lite/tools/lib_cropper/cropper_flags.cc

+ 6
- 1
mindspore/lite/tools/lib_cropper/cropper_flags.cc View File

@@ -92,8 +92,13 @@ int CropperFlags::Init(int argc, const char **argv) {

if (this->output_file_.empty()) {
this->output_file_ = this->package_file_;
} else {
std::string folder_name = this->output_file_.substr(0, this->output_file_.rfind('/'));
folder_name = RealPath(folder_name.c_str());
if (folder_name.empty()) {
return RET_OK;
}
}
this->output_file_ = RealPath(this->output_file_.c_str());
if (this->output_file_.empty()) {
return RET_INPUT_PARAM_INVALID;
}


Loading…
Cancel
Save