From 546a1fcb748d3e3238a158185ad6f61087401ac4 Mon Sep 17 00:00:00 2001 From: ABNER-1 Date: Thu, 26 Dec 2019 14:18:11 +0800 Subject: [PATCH] Fix common util judge error (#835) * '#831 fix exe_path judge error' * #831 fix exe_path judge error --- CHANGELOG.md | 1 + core/src/utils/CommonUtil.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 645a599c62..5f913fce70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/core/src/utils/CommonUtil.cpp b/core/src/utils/CommonUtil.cpp index cdfae8f1e5..7064764590 100644 --- a/core/src/utils/CommonUtil.cpp +++ b/core/src/utils/CommonUtil.cpp @@ -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 + "/"; }