Repository: nifi-minifi-cpp Updated Branches: refs/heads/master ff7aa7fc3 -> 6b317fb4f
MINIFI-180 Duplicate Variable causes MINIFI_HOME to be NULL if ENV variable is not present This closes #36. Signed-off-by: Aldrin Piri <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/6b317fb4 Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/6b317fb4 Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/6b317fb4 Branch: refs/heads/master Commit: 6b317fb4f2ebbeec91fa9930c479c2d929982f42 Parents: ff7aa7f Author: Jeremy Dyer <[email protected]> Authored: Mon Jan 2 17:00:31 2017 -0500 Committer: Aldrin Piri <[email protected]> Committed: Thu Jan 12 10:43:01 2017 -0500 ---------------------------------------------------------------------- main/MiNiFiMain.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/6b317fb4/main/MiNiFiMain.cpp ---------------------------------------------------------------------- diff --git a/main/MiNiFiMain.cpp b/main/MiNiFiMain.cpp index 11e8f00..020fbbd 100644 --- a/main/MiNiFiMain.cpp +++ b/main/MiNiFiMain.cpp @@ -80,8 +80,9 @@ int main(int argc, char **argv) char *path = NULL; char full_path[PATH_MAX]; path = realpath(argv[0], full_path); - std::string minifiHome(path); - minifiHome = minifiHome.substr(0, minifiHome.find_last_of("/\\")); + std::string minifiHomePath(path); + minifiHomePath = minifiHomePath.substr(0, minifiHomePath.find_last_of("/\\")); //Remove /minifi from path + minifiHome = minifiHomePath.substr(0, minifiHomePath.find_last_of("/\\")); //Remove /bin from path } if (signal(SIGINT, sigHandler) == SIG_ERR || signal(SIGTERM, sigHandler) == SIG_ERR || signal(SIGPIPE, SIG_IGN) == SIG_ERR)
