diff --git a/src/cpp/multisolver_interface/environment.cc b/src/cpp/multisolver_interface/environment.cc index 8aae173bc..dd7063680 100644 --- a/src/cpp/multisolver_interface/environment.cc +++ b/src/cpp/multisolver_interface/environment.cc @@ -20,6 +20,8 @@ #include #include #include + +#include "StringManip.h" namespace LoadXpress { #define STRINGIFY2(X) #X @@ -244,7 +246,11 @@ std::string XpressLoader::GetXpressVarFromEnvironmentVariables( xpress_home_from_env = path; } #endif - return xpress_home_from_env; + if (auto env_var_size = xpress_home_from_env.size(); env_var_size > 0) { + return xpress_home_from_env.substr(0, env_var_size - 1); + } else { + xpress_home_from_env; + } } std::vector XpressLoader::XpressDynamicLibraryPotentialPaths() {