Fix common util judge error (#835)

*  '#831 fix exe_path judge error'

* #831 fix exe_path judge error
This commit is contained in:
ABNER-1 2019-12-26 14:18:11 +08:00 committed by Jin Hai
parent 09701c3f2b
commit 546a1fcb74
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Please mark all change in change log and use the issue from GitHub
- \#715 - Milvus crash when searching and building index simultaneously using SQ8H
- \#744 - Don't return partition table for show_tables
- \#770 - Server unittest run failed on low-end server
- \#831 - Judge branch error in CommonUtil.cpp
## Feature
- \#216 - Add CLI to get server info

View File

@ -190,7 +190,7 @@ CommonUtil::GetExePath() {
buf[cnt] = '\0';
std::string exe_path = buf;
if (exe_path.rfind('/') != exe_path.length()) {
if (exe_path.rfind('/') != exe_path.length() - 1) {
std::string sub_str = exe_path.substr(0, exe_path.rfind('/'));
return sub_str + "/";
}